On 6/18/2013 1:52 PM, Jacob Carlborg wrote:
On 2013-06-18 21:41, Walter Bright wrote:

git checkout master
git fetch upstream master
git reset --hard FETCH_HEAD
git push origin master -f

So there it is if anyone else has this problem.

I don't know what you are doing with your git repositories but you shouldn't
have to do a push force (push -f). That's only needed if you changed the
history, which "git reset" will do. Instead just sync all:

1. sync local with origin:

git checkout master
git pull
git push origin master

That didn't work.


2. sync upstream with master

git checkout master
git fetch upstream
git merge upstream/master
git push upstream master

I didn't try that one.

3. sync upstream with origin

git push origin master

That didn't work, either.


If you have changed the history in any of the repository the above won't work.

Hence my problems with it.


I also recommend doing all your work in a special branch (not master) or topic
branches.

I do do all the work in not-master branches. But I make mistakes, and often forget to change branches first. Most of my problems with git revolve around trying to undo mistakes.

Reply via email to