0

By @Vanuan's answer How to import svn branches and tags into git-svn? a svn repo with branches and tags are fetched into git-svn, but then how to import a new-upstream-created tag into git-svn?


Use Case: Mirroring an active-developed svn repo

  1. No write permission to the svn repo;
  2. Sync new tags and branches with the svn repo;
  3. Create new git-only branches, modify and commit to a git repo;
Xiaofeng
  • 532
  • 7
  • 22

1 Answers1

0

git-svn assumes that you are using the git-svn repo to mirror an svn repo. While it is a functioning git repo, any new branches and tags should be created using the git-svn tool. If tags and branches are added as regular 'git' branches and tags, then you'll need to transfer the code across yourself.

I'd suggest you try using git stash to save your local git-only branch changes, run git svn fetch to get the latest changes including any new tags, apply your git stash into a newly created git-svn branch and then use git-svn dcommit to commit them to your svn repo.

  • Thanks @Paul, but it will delete all my non-svn branches. – Xiaofeng Nov 20 '18 at 12:48
  • Hi @Morris, I've added extra details above which hopefully answers your question? – Paul Phillips Nov 23 '18 at 06:59
  • Hi @Paul, I run `java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git --no-delete`, but it still says "Deleting Git branch 'b-trunc' not in Subversion." in dry-run mode. – Xiaofeng Nov 23 '18 at 09:35
  • @Morris see new edits - it appears that the migration script I referenced doesn't support what you want to do. – Paul Phillips Nov 26 '18 at 05:21
  • ``git svn fetch`` does not fetch new tags in my case. – Xiaofeng Nov 29 '18 at 09:55
  • you are right, ``git svn fetch`` does fetch the latest tags. It just does not create a git ``tag``, which should be created manually in my case. Thank you so much. – Xiaofeng Dec 04 '18 at 07:45