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.

  • Importing a patch from one git repo into another
  • GIT clone issue in Jenkins Permission Denied
  • GIT: how to squash several commits that have been pushed to a remote repo?
  • What is Repo and Why does Google use it?
  • git doesn't auto commit when I pull
  • How to fix error “Please set env variable CHROME_BIN” when running Angular.js with grunt
  • 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.

  • What does GitHub for Windows' “sync” do?
  • Get list of final branches (which are final tips)
  • git (sourcetree) go back to commit that has not been pushed and was 'reversed' accidentally
  • Git server allowing pull and push without private key
  • Why doesn't git allow me to safely delete a branch?
  • Key is already in use when trying to add SSH Key to Github
  • 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.