Migracja z svn (wersja serwerowa 1.6.11) do git (wersja 2.9.2) na Windows 10 nie wydaje się działać zgodnie z opisem (chcę zachować wszystkie tagi svn i gałęzie).
Pierwsza próba:
Postępowałem zgodnie z samouczkiem z https://www.atlassian.com/git/tutorials/migrating-convert.
Wynik: wszystkie gałęzie zostaną usunięte po wykonaniu następującego polecenia:
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git
--force
Następna próba:
Postępowałem zgodnie z krokami opisanymi na https://git-scm.com/book/it/v2/Git-and-Other-Systems-Migrating-to-Git:
sprawdź projekt:
git svn clone --stdlayout --authors-file=authors.txt --no-metadata http://<the-svn-url-without-trunk> <module-directory>
Po sprawdzeniu polecenia
git tag -l
produkuje pusty wynik.git branch -a
produkuje następujące dane wyjściowe (zgodnie z oczekiwaniami):*master remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2 remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0 remotes/origin/trunk
Kolejny krok zgodnie z dokumentacją:
To move the tags to be proper Git tags, run
$ cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
$ rm -Rf .git/refs/remotes/origin/tags
Problem:
Ścieżka .git/refs/remotes/origin/tags/
jest pusty. Wszystkie tagi svn wydają się znajdować w
.git/svn/refs/remotes/origin/tags
Katalog .git/svn/refs/remotes/origin/tags
zawierał podkatalog dla każdego znacznika. Próbowałem przenieść te katalogi do .git/refs/tags/
ale prowadzi to do następującego wyniku podczas wykonywania git branch -a
:
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/unhandled.log
* master
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2
remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1
remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0
remotes/origin/trunk
Następna próba
Użyj svn2git z https://github.com/nirvdrum/svn2git. Ale to narzędzie też nie działa. Po uruchomieniu
svn2git <svn-url-without-trunk> --authors ..authors.txt
Komenda git branch -a
wyprodukował następującą produkcję:
* master
remotes/svn/trunk
=> Ten wynik jest całkiem bezużyteczny.
Czego tu brakuje? Czy istnieje dokumentacja dotycząca systemu Windows i najnowszej wersji git 2.9.2?
Odpowiedzi:
1 dla odpowiedzi № 1W przypadku importu w jedną stronę możesz spróbować import subgit
SubGit ma bezpłatną ofertę importową i ogólnie jest bardziej kompletna niż git svn
.