Why does git not recognize “origin/master” as a valid object name?

后端 未结 3 811
无人及你
无人及你 2021-02-19 07:27
~/www> git branch --track live origin/master
fatal: Not a valid object name: \'origin/master\'.
~/www> git remote
origin
~/www> git branch
* master
  test_branc         


        
3条回答
  •  再見小時候
    2021-02-19 07:39

    $ git branch -r
      origin/1.x
      origin/1.x@60
      origin/1.x@63
      origin/HEAD -> origin/master
      origin/master
    
    $ git branch --track live origin/blah
    fatal: Not a valid object name: 'origin/blah'.
    

    As has been suggested you can only track a remote if it has been added. Perhaps add the remote like this

    $ git remote add upstream git://github.com/svnpenn/rtmpdump.git
    
    $ git fetch upstream
    

    Example

提交回复
热议问题