Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repository do not show changes

Daniel Mielnicki September 5, 2015

screen.png

Hey,

 

I have a problem with SourceTree, I can't push my files anymore (I could push it but it doesn't appear on bitbucket repository). =(

I commited and pushed it 2 times (fine) and on the third time I commited and pushed it again but on bitbucket I have only 2 commits and the third doesn't show up my code did not change too.

I don't know what origin/master master or HEAD means, because it is the first time I work with it.

2 answers

1 vote
Kaz September 6, 2015

I am not a Git expert but master is the latest revision on your local copy and origin/master is on Bitbucket in your case. Since HEAD is ahead of master, it would not be pushed. You should be able to check out master while keeping your local changes and re-commit on master to move it forward. Then you can push master to Bitbucket. Please make sure you have a backup copy before trying this.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2015

It sounds like you checked out and committed to HEAD. This is an incorrect usage of Git. You should have received a warning from SourceTree about a "disconnected HEAD" whenever you checked it out.

You can fix this by checking out "master", then right-clicking the top commit and choose "Reset current branch to this commit...", then choose "Hard" in the dialog. This should put master on the same commit as HEAD, and you can then push master to origin/master.

FYI, "master" is the pointer to the latest commit in your LOCAL master branch. "origin/master" is the pointer to the latest commit in the REMOTE master branch (specifically the remote named "origin").

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events