git执行如下代码
git checkout -b daily/1.0.0 origin/daily/1.0.0
遇到报错
fatal: ‘origin/daily/1.0.27’ is not a commit and a branch
‘daily/1.0.27’ cannot be created from it
解决办法:
git fetch --all
原因:
报错说is not a commit而不是说branch doesn’t exist,是因为git 拿到了你指定的参数origin/daily/1.0.0 然后尝试把它解析为commit hash.
同样,如果你用tag name或者commit hash同样会产生这样的错误,如果git无法解析所提供给特定提交的分支, 通常是因为它没有最新的远程分支列表。
–all tag包含了多个远程, e.g. origin, buildserver, joespc, etc
git fetch默认拉去origin这个远程
同样你也可以指定某个远程,git fetch buildserver,依次来拉取远程buildserver的所有分支
如果想查看自己的所有远程, 可以执行命令git remote -v