[Numpy-discussion] Can we freeze the subversion repository and move to github this week?

Pauli Virtanen pav@iki...
Wed Sep 15 05:08:21 CDT 2010


Wed, 15 Sep 2010 10:58:57 +0200, Gael Varoquaux wrote:
[clip]
> Now I have a problem: at step 1 I should have created a branch. I did
> not. I need to go back and create a branch. This was happening at a
> sprint, and people that know git better than me helped me out. But the
> only way we found to sort this out was to create a branch at step 1,
> merge the branch with master, and 'reset -a' master at step 1. I thought
> it over quite a few times, and did not loose any data. However, I was
> very uncomfortable with the process (the 'reset -a').

I would maybe have moved the stuff in master to a new branch via:

$ git branch work master              # move stuff in master to new branch
$ git branch -f master origin/master  # roll master back to origin/master

Ok, here we used a --force switch.

> What was the right solution (apart from 'create branch at step 1')?

Pushing to origin/master from feature should be possible:

$ git checkout feature
$ git fetch origin
$ git merge origin/master  # if needed
$ git push origin feature:master

> This really illustrates what git feels like me: linux in root mode,
> powerful, unsafe if you don't understand it well.

Avoiding the --force switches and reset helps a bit.

Also, personally I always tend to do history rewriting in a new branch, 
so I can easily re-do it, if necessary.

$ git branch tmp original-branch
... do whatever history altering necessary ...
... check for mess-up ...
$ git branch -f original-branch tmp  # overwrite old branch
$ git branch -d tmp

	Pauli



More information about the NumPy-Discussion mailing list