1

I git svn clone 'd the SVN repository a month ago and started building the source code with newer version of compiler. Within a month, the original SVN repo has changed (number of people made a bunch of commits). Now I want to have all those changes in the git repository.

I tried adding svn-remote section to the config file of git. according to this

But it did not work. Any ideas or suggestions ? I would like to have a history of all commits that were made to the svn repo. (authors and commit messages in the git log)

Thank you

Community
  • 1
  • 1
Trojosh
  • 565
  • 1
  • 5
  • 15
  • `git svn rebase` - https://git-scm.com/docs/git-svn – 1615903 Nov 03 '15 at 07:34
  • How did you clone svn in the first place? Does `git svn info` show you the original svn repo? Then simply follow the advice above. – Mykola Gurov Nov 03 '15 at 22:00
  • git svn info give me `Unable to determine upstream SVN information from working tree history` – Trojosh Nov 04 '15 at 02:24
  • I did `git svn clone --preserve-empty-dirs --authors-file= /path/to/git/local – Trojosh Nov 04 '15 at 02:29
  • @1615903 , `git svn rebase` gave me the same error: `Unable to determine upstream SVN information from working tree history` Is that because I am working on my git branch and not on the mainline ? SVN's notion of branch is quite different from that of Git.. – Trojosh Nov 04 '15 at 02:33

1 Answers1

0

When you create a Git working directory using git svn clone, under the covers it runs a bunch of different commands: git init to set up the initial Git repository, git svn init to set up the Subversion metadata, then git svn fetch to pick up all the commits from the Subversion repository.

Running git svn fetch again will pick up all the changes since your last git svn fetch (or that initial clone) and add them to your Git history.

That said, if you've since messed around with the Git configuration, you may find you have new problems, since you could have messed up the original configuration. Your best bet if that's the case is to remove the initial Subversion metadata with git config --remove-section svn-remote.svn and then run git svn init with the same arguments you gave to git svn clone the first time around.

me_and
  • 15,158
  • 7
  • 59
  • 96