There's also this git command I just discovered. It seems to solve all of these issues, and the documentation is written in the same crystal-clear style of the other git manpages:
From: Paul Ivanov [pivanov314@...]
Sent: Thursday, March 24, 2011 8:20 PM
Subject: Re: [matplotlib-devel] I screwed up matplotlib/master on github
Matthew Brett, on 2011-03-24 16:37, wrote:
> Welcome to the wonderful world of git and DVCS!
Thanks, I wish I could claim that I only started using git
recently, but I've just sort of been uncomfortably trying my best
to not cause too much trouble for the past year and a half...
> I think you could have solved this one by:
> git reset --hard 8506c33c811e970c6aa73a446d3ed223ac48f989
> and pushing that. Assuming you had that commit, which I guess you would have.
This actually wasn't the case - I hadn't pulled from
matplotlib/master for a few days, hence the stale commit become a
head after my push.
> The way I try and avoid doing that very easy thing is
> 1) Having a moderately frightening name for the upstream remote like
> 2) Having a moderately frightening name for the tracking branch like:
> git co -b main-master --track upstream-rw/master
good tips, thanks.
> 3) Making sure I've got the git-completion bash command line
> completion tools working, so I can always see my branch name
This was actually the case for me - I wasn't working on master,
but a seperate branch called 'one-figure' which didn't have a
remote branch affiliated with it (or a wrong one). I had
previously pushed it using 'git push ivanov one-figure', and
*wrongly* assumed that this state was preserved somewhere
> 4) Never working on main-master, always branching, and merging when I'm sure.
> 5) Deleting my own master branch to avoid confusion. This involves:
> Going to your github fork, choosing Admin, set default branch to be
> something other than 'master'
> git co that-other-branch
> git branch -D master # delete locally
> git push origin :master # delete on github
> Every error, is a jewel.
Wise words, but if that were true, De Beers and Tiffany's
couldn't hope to compete with me.
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7