Git
Migration SVN-2-Git
Stratégie de migration :
La source est un repository SVN avec une structure classique trunk/branches/tags
La conversion sera effectuée via “git clone” (sans vraiment plus de nettoyage)
Le repository Git sera hébergée (“push”) sur une machine distante
Visible depuis une interface Gitweb
Conversion du projet
PROJECT=metacomp
cd ~/incoming/git-migration
git svn clone http://svn.drazzib.com/$PROJECT --no-metadata -T trunk -b branches -t tags $PROJECT
cd $PROJECT
Préparation du repository distant
PROJECT=metacomp
mkdir -p $HOME/git/$PROJECT.git
cd $HOME/git/$PROJECT.git
git --bare init
touch git-daemon-export-ok
git --bare update-server-info
mv hooks/post-update.sample hooks/post-update
ln -s /home/drazzib/git/$PROJECT.git /data/git/
Publication vers un repository distant
PROJECT=metacomp
cd ~/incoming/git-migration/$PROJECT
git remote add origin git+ssh://git.drazzib.com/home/drazzib/git/$PROJECT.git
git push origin master
git push origin master --tags
Références
http://bazoud.free.fr/post/2010/12/11/migration-de-svn-vers-git-en-4-etapes/
http://www.jedi.be/blog/2009/05/06/8-ways-to-share-your-git-repository/
http://www.thebuzzmedia.com/git-tip-git-push-no-refs-in-common-and-none-specified/
http://priodev.blogspot.com/2010/02/hosting-your-git-repository-on.html
Astuces
Modifier le dernier commit
Méthode “manuelle” :
git reset --soft HEAD^
[...MODIFS...]
git commit -a -c ORIG_HEAD
Méthode automatique :
[...MODIFS...]
git commit --amend