Unable to determine SVN information upstream from the HEAD history

Why do I need this error message?

+59
git git-svn
Aug 13 '09 at 1:20
source share
10 answers

(I posted the “question” to Chad as an answer, fixed the formatting and typos.)

There are several reasons for this error message.

The first, being the most common. There are two disjoint stories in your git repository: the story you created in git, and the story from a remote svn repository.

To fix this, you need your git repository and svn repository to have one common ancestor so that git can understand which commits have changed and what.

The following article discusses how to solve the problem:

The second possible cause of the problem is if you have an earlier version of git (possibly the windows package msysGit) and you just created a new git repository that interacts with the remote svn repository.

For example:

git svn init svn://svn.xxx.xxx/xxx/trunk git svn fetch -r BASE:10 

or

 git clone svn://svn.xxx.xxx/xxx/trunk // Adds all the files in the revision... 

And you get the following error messages when using the following commands.

 git svn info 

Unable to determine upstream SVN information from the working tree or

 git svn rebase 

it is impossible to determine upstream svn information, working history of a tree or

  git svn dcommit 

Unable to determine upstream SVN information from HEAD history

If you get the above error messages, first check the git version. If you are using an older version of git <= 1.6.3.3. *, Which was in my case with (msysGit), the easiest way to solve the problem is to update it to the latest version of git, such as 1.6.4. *.

The following article discusses the problem in more detail.

+34
Aug 10 2018-10-10T00:
source share

I received this message due to the cloning of the svn repository with the --no-metadata option. Maybe the case is with your problem too.

When cloning without this option, everything is fine.

The --no-metadata is for cloning the SVN repository when a new git clone should be included in the canonical source in the future. He does not have the ability to return to SVN upstream, because he does not have the ability to track the differences between the git clone and SVN upstream.

+29
Oct 26 '10 at 7:23
source share

In my case, the header from the svn repository should match the header from the git repository. This should solve the problem:

 git update-ref refs/remotes/git-svn refs/remotes/origin/master 

If you use another git branch for svn trunk, for example svntrunk , this branch should be referenced, svntrunk .:

 git update-ref refs/remotes/git-svn refs/remotes/origin/svntrunk 
+17
Sep 26 '11 at 11:55
source share

I got this message after I incorrectly added the -s / --stdlayout to the git svn clone for the Subversion repo, which did not have a “standard Subversion layout” trunk , tags and branches relative paths.

(The Subversion repos that I usually clone have standard relative paths, so when I cloned a Subversion repo that didn't have them using my regular git svn clone , I got this cryptic message. The message is 100% correct, but almost 100% useless when trying to figure out what the problem is.)

+9
Jul 19 '11 at 20:01
source share

You can also get this error when you have a check on a newly created SVN repo.

I decided it

  • First do initial commit via svn command
  • Then clone the repo using the git svn command.
+8
May 21 '13 at 10:52
source share

got the same problem, here is a solution based on the http://eikke.com/importing-a-git-tree-into-a-subversion-repository/ article:

 $ git svn init http://server.com/svn/project/trunk/prototypes/proto1/ $ git svn fetch W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: '/svn/!svn/bc/100/dcom/trunk/prototypes/ws' path not found W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories r147367 = 37c9910f794cb9cff7ca0d5d2eb26e1f0dabbc4d (refs/remotes/git-svn) $ svn log http://server.com/svn/project/trunk/prototypes/proto1/ ------------------------------------------------------------------------ r147367 | user | 2014-01-16 18:02:43 +0100 (Thu, 16 Jan 2014) | 1 line proto1 home ------------------------------------------------------------------------ $ git log --pretty=oneline master | tail -n1 71ceab2f4776089ddbc882b8636aacec1ba5e832 Creating template ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #1 $ git show-ref git-svn 37c9910f794cb9cff7ca0d5d2eb26e1f0dabbc4d refs/remotes/git-svn ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #2 $ echo "71ceab2f4776089ddbc882b8636aacec1ba5e832 37c9910f794cb9cff7ca0d5d2eb26e1f0dabbc4d" >> .git/info/grafts $ git svn dcommit Committing to http://server.com/svn/project/trunk/prototypes/proto1 ... A README.md A pom.xml A src/main/java/.gitkeep A src/main/resources/.gitkeep A src/main/webapp/WEB-INF/web.xml A src/main/webapp/index.html A webapps/.gitkeep Committed r147419 A README.md A pom.xml A src/main/java/.gitkeep A src/main/resources/.gitkeep A src/main/webapp/WEB-INF/web.xml A src/main/webapp/index.html A webapps/.gitkeep r147419 = 6a8bda7262739306d0a6e17eaad2802737dedc35 (refs/remotes/git-svn) No changes between current HEAD and refs/remotes/git-svn Resetting to the latest refs/remotes/git-svn Unstaged changes after reset: M pom.xml M src/main/webapp/index.html A .gitignore Committed r147420 M pom.xml M src/main/webapp/index.html A .gitignore r147420 = 749b5acec55c341672bca08d07de8c336b5a4701 (refs/remotes/git-svn) No changes between current HEAD and refs/remotes/git-svn Resetting to the latest refs/remotes/git-svn ...etc... 
+8
Jan 17 '14 at 10:55
source share

Another cause of this problem is the incorrect svn-remote.svn.rewriteRoot (see this answer for instructions on how to use it).

The git-svn-id in your records imported from Subversion should match the rewriteRoot URL if one is set.

+2
Sep 25 2018-11-11T00:
source share

I received this message because I used the fully qualified domain name for the git svn init , but the pre-existing git svn init integration used only the host name.

eg. grep git-svn-id showed:

 git-svn-id: svn://host/repo/... 

But I did:

 git svn init -Ttrunk svn://host.domain.com/repo 

(We have a machine that regularly synchronizes the git repository with svn, then everyone else has git config --add remote.origin.fetch refs/remotes/*:refs/remotes/* to extract the branches synchronized by svn.)

+2
May 01 '13 at 10:33
source share

Another possible reason: if you have svn-remote..rewriteUUID config installed, git -svn may have a problem finding the right metadata for the repository. For example, you might have something like this (see the git-svn man page for a discussion of why you would like to do this):

 [svn-remote "svn"] url = svn://read-write.test.org fetch = trunk/project:refs/remotes/trunk rewriteRoot = http://read-only.test.org/svn rewriteUUID = 1234-abcd 

... where 1234-abcd is the read-only mirror UUID. When you git svn fetch ', you can get this file:

 .git/svn/refs/remotes/trunk/.rev_map.5678-dcba 

... where 56780-dcba is the read-write repository UUID. Correction:

 $ mv .git/svn/refs/remotes/trunk/.rev_map.5678-dcba \ .git/svn/refs/remotes/trunk/.rev_map.1234-abcd 

One cannot say for sure whether this is a long-term solution, i.e. it may get confused the next time you "w22> svn fetch". You can try a symbolic link, not "mv", I have not experimented with this.

0
Apr 11 '14 at 18:29
source share

I saw this after using the BFG Repo-Cleaner https://rtyley.imtqy.com/bfg-repo-cleaner/ and rewriting the git history (intentionally) and then trying to run git svn fetch again. The message shows that the git <-> svn match is lost.

To solve this problem, read https://git-scm.com/docs/git-svn
At the very bottom it shows:

$ GIT_DIR / SVN / * /. Rev_map

The mapping between Subversion revision numbers and Git commit names. In a repository where the noMetadata option is not set, it can be rebuilt from the git-svn-id: lines that are at the end of each commit (see the svn.noMetadata section above for details).

To do this, you need to have git-svn-id comments in the commit comments. If you do, you can delete the .rev_map file. * And rebuild it.

 rm .git/svn/refs/remotes/git-svn/.rev_map.* git svn info 

This should show:

 Rebuilding .git/svn/refs/remotes/git-svn/.rev_map.{snip} ... ... Done rebuilding .git/svn/refs/remotes/git-svn/.rev_map.{snip} Path: . ...and then regular git svn info output 
0
Aug 01 '18 at 15:58
source share



All Articles