Reputation: 148524
Simplification :
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
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
:
But even after that , sourcetree shows that they are not the same :
Even though if I check for changes , I see no changes :
Question:
If remote master
and local master
has no differences , why does sourcetree show me pull
?
Even git status
shows I'm ok (without pull) :
Upvotes: 2
Views: 117
Reputation: 963
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.
Hope this will help.
Upvotes: 1
Reputation: 59913
Sometimes Sourcetree gets out of sync with your local repository. When this happens, simply tell Sourcetree to refresh its view with F5 (Windows) or ⌘+R (macOS).
Upvotes: 1
Reputation: 26066
General advice: whenever a GUI that wraps a CLI program or library seems to misbehave, it is a good idea to check directly with the actual CLI program or library.
In this case, running a fetch:
git fetch origin
And then checking where the branches point to using:
git log master origin/master
Or perhaps:
git branch --all --verbose
Or even:
git show master
git show origin/master
allow you to check to which commit (hash) the branches actually point, and therefore confirm (or not) whether the GUI has a problem.
Even if you confirmed that SourceTree does not show the issue when reopening it, I would double-check with Git directly, just in case.
Upvotes: 1