5

We use Subversion locally, and we're working on a project that uses a fork of Fluent NHibernate, which is hosted on Github.

I'd like it set up so that a single svn checkout will retrieve everything necessary to build the project, but maintain the ability to fetch HEAD updates from github.

Is there any way I can pull code from the Git repository as though it was an svn:external dependency? Can I just check the .git folder into our Subversion repository and just run git fetch when I need to, then svn commit the results?

Aziz Shaikh
  • 16,245
  • 11
  • 62
  • 79
Dylan Beattie
  • 53,688
  • 35
  • 128
  • 197

2 Answers2

6

http://github.com/blog/626-announcing-svn-support says

$ svn checkout https://github.com/USER/PROJECT/trunk

works. So use that URL for your svn:externals.

orip
  • 73,323
  • 21
  • 116
  • 148
ndim
  • 35,870
  • 12
  • 47
  • 57
  • how about a github specific tag/branch? – farinspace Sep 26 '11 at 16:19
  • +1. Also, GitHub updated their svn support so I updated the URL. https://github.com/blog/966-improved-subversion-client-support – orip Jan 05 '12 at 11:10
  • 1
    @farinspace See the new URL: try adding `/branches/FOO` or `/tags/BAR` – orip Jan 05 '12 at 11:11
  • How about a specific revision number? There is no such thing as a "revision number" in git, but this seems like the sort of thing that lots of people might have a need for. – ibell Feb 24 '14 at 23:02
0
  • Specific commit: You need to find the appropriate revision number from the git repository using the SHA1 hash:

    $ git svn find-rev <sha1>
    

    Next, use the peg revision syntax for the revision number in your svn:externals definition.

    https://github.com/<user>/<project>@<revision>
    
  • Specific tag (from @orip's comment):

    https://github.com/<user>/<project>/tags/<tag>
    
  • Specific branch (from @orip's comment):

    https://github.com/<user>/<project>/branches/<branch>
    
keplerian
  • 512
  • 1
  • 8
  • 19