简体   繁体   中英

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
  remotes/origin/1335-branch
  remotes/origin/master
  remotes/origin/tags/0.1
  remotes/origin/trunk

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM