Lorsque l'on veut déposer toute une lignée historique d'un dépôt git dans un dépôt svn, on est confronté à un problème. Voici sa description.
Le projet s'appelle installations
.
# cd /data/svn/installations # ls -a1 . .. .git .gitignore kickstart # git svn init https://svn.examnple.com/installations/ Using existing [svn-remote "svn"] svn-remote.svn.fetch already set to track :refs/remotes/git-svn # git svn fetch W: +empty_dir: branches W: +empty_dir: tags W: +empty_dir: trunk r1 = fac23ae26613d7ff209afaa3e4c69c6e74ca8df9 (refs/remotes/git-svn) r1 = 24cbaa59317557ed5d1d9866690b376ac24f8227 (refs/remotes/trunk) # git svn dcommit Unable to determine upstream SVN information from HEAD history. Perhaps the repository is empty. at /usr/lib/git-core/git-svn line 519. |
Version de git utilisée : 1.7.2.
# création d'une branche pour recréer l'historique git pour svn git checkout -b svnrebase trunk # cherry-pick du commit initial (premier commit de l'historique) git cherry-pick 277039e1557526f73a2ff963a1f66de7069b7c34 # réordonancement de l'historique du début jusqu'à maintenant git rebase --onto svnrebase 277039e1557526f73a2ff963a1f66de7069b7c34 master # commit svn du résultat avec suppression des répertoires laissés vides git svn dcommit --rmdir |
Pour résoudre le problème, voici une page d'aide :