sdgathman / pyspf

Other
49 stars 26 forks source link

rename master branch #11

Closed sdgathman closed 4 years ago

sdgathman commented 5 years ago

As noted in the readme, cvs2git chose the wrong master. While the normal checkout/commit/push/pull of git is pretty intuitive, some of the more subversive operations are not easy to understand. I'm getting some lessons from dkg in https://github.com/sdgathman/pymilter/issues/27

gpatel-fr commented 5 years ago

I am certainly no git expert, but here is my take on it Step 1: create a duplicate of the pyspf repo (you can skip it as you already have it of course, but I wanted to try first)

git clone https://github.com/sdgathman/pyspf
cd pyspf
git checkout pyspf-1_7-branch
git checkout pyspf-2.1
git checkout pyspf-2_0-branch
git checkout master
git config -e  → replace sdgathman by gpatel-fr
git remote -v  → I am master now
curl -u gpatel-fr https://api.github.com/user/repos -d '{"name":"pyspf"}'
→ get a bunch of github goo
git push --all origin
→ verify on github that the repo looks good

now I have a new project totally unrelated to the existing source repo

step 2 change


cd ..
rm pyspf -rf

git clone https://github.com/gpatel-fr/pyspf
git branch -a -> looks similar to existing source repo

git checkout pyspf-2_0-branch
git branch -m master oldmaster
git branch -m pyspf-2_0-branch master
git branch -rD origin/master
git push --force --all

did I miss something ?
sdgathman commented 5 years ago

On Wed, 5 Jun 2019, gpatel-fr wrote:

git clone https://github.com/gpatel-fr/pyspf git checkout pyspf-2_0-branch git branch -m master oldmaster git branch -m pyspf-2_0-branch master git branch -rD origin/master git push --force --all

did I miss something ?

No. I hadn't noticed the -m option (you have to read the long description to see that it means "rename"). And other people have suggested much more complicated solutions. If I have a copy of the repo, it should be safe to try your very simple solution.

Thanks!

I just moved to git a few years ago, and don't know all the tricks yet - I just discovered rebase with cherry picking commits a few months ago!

After CVS, I moved to bzr - but although git was more confusing at first, it eventually became clear that git was more powerful and flexible, supports signed commits, etc.

-- Stuart D. Gathman stuart@gathman.org "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

sdgathman commented 4 years ago

I finally did it. I seem to have even done it correctly, thanks to @gpatel-fr .