Giovanni Azua Giovanni Azua - 10 months ago 99
Git Question

fatal: Not a valid object name: 'refs/remotes/trunk'

After using

git svn
with clone and fetches I end with a local git repository that looks as follows. Note that I have made a first push to my Git server Atlassian's Stash but as result I only have in-sync with the git server the master branch:

c:\myproject>git branch -a
* master

Following direction from Migrating from SVN to Git ... and trying to convert the remote svn branches to local Git branches I do:

c:\myproject>git branch origin/trunk refs/remotes/trunk
fatal: Not a valid object name: 'refs/remotes/trunk'.

and then I get the OP error
fatal: Not a valid object name: 'refs/remotes/trunk'
and I can't see why it happens

Answer Source

Your tutorial is probably made with a different version of git-svn. Formerly the --prefix was empty by default, in newer versions it is origin/ by default. Because of that you have now refs/remotes/origin/trunk and so on instead of refs/remotes/trunk.