Repository do not show changes

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

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,258 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you