what is the git-svn-id?

Here is an example git-svn-id from a local test repo.

git-svn-id: file:///tmp/svnrepo/branches/foobar@6 0f7bc949-3f51-4b04-a2a6-16f580a5904d

What is the last part? The “@6” means that it is svn revision number 6, but after that looks to be some hash. It seems to be the same on every single commit.

  • Eclipse EGit Checkout conflict with files: - EGit doesn't want to continue
  • npm install from private gitlab repository - authentication failed
  • git-svn problem
  • Where to place Git repository
  • What is the recommended source control ignore pattern for Seam projects?
  • Kubuntu/Windows 7 dual-boot and git
  • How is that last part generated? I am assuming it is a hash algorithm applied to the first commit of the git repo. That way the git-svn-id can also guarantee that the total ancestry of that commit is the same or different given another git-svn-id.

  • Git: Storing but not pulling LESS files
  • when trying to update a newly created remote branch, I get “rejected”
  • In git, when using difftool I get mergetool instead
  • Moving directories for portable git configuration
  • Git fetch a single commit
  • Git: List all files in a directory across all branches?
  • One Solution collect form web for “what is the git-svn-id?”

    It’s a subversion construct. In subversion, every repo is given a UUID. You can find a svn repo’s UUID via svn info. In the example below, the “Repository UUID” line is the repo’s UUID.

    $ svn info
    Path: .
    Working Copy Root Path: /tmp/svnco
    URL: file:///tmp/svnrepo
    Relative URL: ^/
    Repository Root: file:///tmp/svnrepo
    Repository UUID: 0f7bc949-3f51-4b04-a2a6-16f580a5904d
    Revision: 6
    Node Kind: directory
    Schedule: normal
    Last Changed Author: ABird
    Last Changed Rev: 6
    Last Changed Date: 2015-02-23 16:54:45 -0500 (Mon, 23 Feb 2015)

    Here is the git-svn code which seems to read svn info output and saves the UUID: https://github.com/git/git/blob/master/vcs-svn/svndump.c#L356

    To address some of my assumptions in the question: the UUID does not incorporate any information about the git repo’s ancestry. From my understanding, someone can git svn clone the same repo, but not include the entire history of the repo. If that is the case between two git-svn repos, then the same point in the svn repo will become different sha1 hashes in the two repos.

    Git Baby is a git and github fan, let's start git clone.