It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Local and Remote Repo not Synced

Hi there, I'm pretty new to GIT and Bitbucket and I have run into a problem because I'm new to this. My repo on bitbucket is not in sync with my local but when I'm trying to push my local repo to bitbucket it says everything is the same so nothing happens.

Everything was working fine until Git was telling me I couldn't push, being sure of what I thought was the solution I force pushed to bitbucket.

The force didn't do what I expected, on bitbucket I have 4 commits with the last one on the 13th of may. So by force pushing it didn't push my last commit but it somehow removed a few commits.
Locally I see 10 commits with the last one today. When I try to push it again it says there are no changed even though the commits are different and the code should be too.

I don't know exactly what I've done wrong an how I can solve this so that the commits I see locally are also on bitbucket.

Hope someone can help me with this,

Thanks in advance,


1 answer

0 votes
Ana Retamal Atlassian Team May 31, 2017

Hi Joost!

Have all the files been staged and commited? You can get the status of your local repository and see how your local project is progressing in comparison to your Bitbucket repo. If there are any untracked files, that means that Git does not see them as part of a previous commit and thus, they'll be invisible for Bitbucket. To check the status you can use:

git status

If there are untracked files, you'll need to tell Git to track them. To do so use:

git add <file_name>

Now that all your files have been staged, you can commit them and then push using:

git push origin master

To learn more, please visit Copy your git repository and add files.

If get status was not showing any differences between your local repo and Bitbucket, please let us know so we can help you further.



Hi Ana,

Thanks for your help, I always use

git add .

to track my files, and as you suggested I tried

git status

but this is the reply

On branch master
nothing to commit, working tree clean

This is my local log in my phpstorm editor:
Schermafbeelding 2017-05-31 om 20.43.19.png

And these are my commits in bitbucket.Schermafbeelding 2017-05-31 om 20.42.51.pngAny idea on how to get them synced again?


jredmond Atlassian Team May 31, 2017

All your recent commits are on Master, but you're pushing master. The capital M makes a big difference here.

Aha, and how do I solve this issue? Can i get rid of the double M/masters? And sync to bitbucket again? 

jredmond Atlassian Team May 31, 2017

Based on the phpstorm snapshot, you should be able to do a fast-forward-only merge from Master into master, then push master and delete Master:

git checkout master
git merge --ff-only Master
git push origin master
git branch -d Master

Thanks Jim, when i try to merg it says:

Already up-to-date

So it seems the merge is not working. Sorry I feel a bit dumb to ask for everything but I'm a bit worried that when I try something I make a total mess of this :D.


Hello Ana or Jim,


Could you help me further with this problem I have? Merge doesn't seem to work. Hope one of you can help me.



jredmond Atlassian Team Jun 05, 2017

Are the commits from big-M Master now available in small-m master on your local system? What about on Bitbucket?

No nothing was changed but I tried different stuff yesterday and got it solved.

I first reset my local repo to the point where my remote repo at bitbucket was at. I then added, committed and pushed everything from local to bitbucket.

Then on my own remote server I fetched, and reset --hard to get this one in sync aswell.

So everything is working perfectly now. Still don't know where the M-aster came from. I tried to reproduce it but that didn't work.

Well thanks a lot for all help!



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...

986 views 1 17
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you