如何比较Visual Studio代码1.9上的不同分支?可能吗?
虽然添加fetch = +refs/pull/*/head:refs/remotes/origin/pr/*到.git/config允许获取和结帐,但拉动操作失败:
[remote "origin"]
url = https://github.com/the/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
Run Code Online (Sandbox Code Playgroud)
获取和结帐工作正常:
$ git fetch origin
Run Code Online (Sandbox Code Playgroud)
... 都好
$ git checkout -b "pr-123" origin/pr/123
Branch pr-123 set up to track remote branch pr/123 from origin.
Switched to a new branch 'pr-123'
Run Code Online (Sandbox Code Playgroud)
...成功,得到了代码!
但拉动失败:
$ git pull
Your configuration specifies to merge with the ref 'refs/heads/pr/123'
from the remote, but no such ref was fetched.
Run Code Online (Sandbox Code Playgroud)
......失败了.
我可以手动指定ref:
$ git pull origin refs/pull/123/head …Run Code Online (Sandbox Code Playgroud)