Search code examples
gitatlassian-sourcetree

Git shows differences even after `push --force`?


Simplification :

enter image description here

In my master branch I've added some garbage.
Then I pushed it to origin/master

Later I've discovered that it was a mistake to add that garbage. I know I can/should create a revert commit.

But I didn't. I did a git reset --hard

enter image description here

But now I want that the origin/master will look exactly the same as my local.

Obviously I can't push becuase git tells me to pull before push.

So I did push --force:

enter image description here

But even after that , sourcetree shows that they are not the same :

enter image description here

Even though if I check for changes , I see no changes :

enter image description here

Question:

If remote master and local master has no differences , why does sourcetree show me pull ?

enter image description here

Even git status shows I'm ok (without pull) :

enter image description here


Solution

  • SourceTree checks the remote status periodically.

    Solution 1: Simply reopen the Sourcetree

    Solution 2: Tools>Options>General check default remotes for updates every X minutes. Make the X to 1/2 to get to see the status change faster. Like as the image you can see the updated status after 1 minute.

    change remote update time

    Hope this will help.