Unable to determine upstream SVN information from HEAD history

(Posted Chad's "question" as an answer, fixed formatting and typos.)

There are a couple of causes for this error message.

The first, being the most common. You have two disjoint histories in your git repository: The history that you made in git, and the history from the remote svn repository.

To fix this, you need to make your git repository and svn repository share one common ancestor so git can figure what commits have changed what.

The following Article, discusses how to fix the problem:

The second possible cause of the problem is if you have an early version of git (possible, windows msysGit package) and you have just created a new git repository that communicates with a 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 follow error messages, when using the following commands.

git svn info

Unable to determine upstream svn information from working tree or

git svn rebase

unable determine upstream svn information working tree history or

  git svn dcommit

Unable to determine upstream SVN information from HEAD history

If you get the above error messages, first step is to check your git version. If your running a older git version <= 1.6.3.3.* that was in my case with (msysGit), then the easiest way to fix the problem is to update to a newest version of git such as 1.6.4.*.

The following Article discusses the problem in more detail.


In my case, the HEAD from the svn repo should have been matched to the HEAD from the git repo. This should solve the problem:

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

If your use a different git branch for svn trunk, for example svntrunk, that branch should be referenced instead, that is:

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

i got this message because of cloning the svn repo with --no-metadata option. Maybe that's the case with Your problem too.

When cloning it without that option everything is fine.

The --no-metadata option is meant to clone an SVN repository when the new git clone is to be come the canonical source in the future. It lacks the capacity to commit back to the SVN upstream, because it has no way to track differences between the git clone and the SVN upstream.

Tags:

Git

Git Svn