Today's github tip - fixing local master

Jacob Carlborg doob at me.com
Tue Jun 18 13:52:57 PDT 2013


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

2. sync upstream with master

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

3. sync upstream with origin

git push origin master

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

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

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list