[英]How to retain git authorship and commit date when using git-svn to push to a subversion repo?
我們從一個新的空的subversion存儲庫和一個現有的git存儲庫開始,我想“推送”並保留所有歷史記錄和作者身份(如果可能,甚至只是用戶名)。
使用“git svn dcommit”我能夠在subversion repo的歷史記錄中看到修訂注釋,但作者詳細信息默認為我在subversion中的用戶名,提交日期變為今天的日期,即推送日期而不是git中的初始提交。
是否有方法可以覆蓋這些感興趣的屬性,就像BZR-> SVN一樣,bazaar.conf覆蓋並修改了pre-revprop-change鈎子,但這次是針對Git?
謝謝。
您不能使用git-svn保留作者和日期(以及您也不能使用它保留忽略,匿名分支和復雜歷史記錄)。
為了將Git存儲庫轉換為SVN,保留所有使用SubGit項目:
$ svnadmin create svn.repo
$ subgit configure svn.repo
$ #edit svn.repo/conf/subgit.conf ('git.default.repository' option)
to set path to your bare Git repository (the repository you on the server
or you can prepare new bare repository
with "git clone --bare <Git URL> path/to/bare/git/repo")
$ #optionally prepare svn.repo/conf/authors.txt file
to configure custom authors mapping
$ subgit install
安裝后,SubGit將同步並保持同步SVN存儲庫svn.repo和Git存儲庫路徑/到/ bare / git / repo,這樣任何對SVN的提交都將導致Git提交,反之亦然(同步由鈎子同時驅動) -safe,所以你仍然可以繼續使用Git)。
停止連續同步運行
$ subgit uninstall svn.repo
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.