18
0
Fork 0

ajout d'un paragraphe sur comment migrer un depot git

This commit is contained in:
Daniel Jakots 2016-12-17 20:16:49 -05:00
parent 2793f2774c
commit 2c7f76334f
1 changed files with 8 additions and 0 deletions

View File

@ -680,4 +680,12 @@ $ git repack
$ git gc
~~~
### Migrer un dépot git
Il se peut qu'on change de forge (passage de gitolite à gitlab par
exemple) et il faut alors migrer les dépots. Un moyen de faire :
~~~{.bash}
$ for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do rbranch=$(echo $branch | tr '/' ' ' | awk '{print $3}') ; git checkout -b $rbranch $branch ; done
$ git remote add gitlab gitlab@gitlab.example.com:group/repo.git && git push gitlab --all && git remote remove origin && git remote rename gitlab origin && git push --set-upstream origin master
~~~