我有 machine1 和 git repo client
,它有分支master
和fixes_v3
. 我有 machine2,无论我尝试什么组合,它都会拉出一个分支并命名它,fixes_v3
但它的内容是master
. 例如:
git clone git+ssh://user@machine1/home/user/client
给我这个
git pull
给我这个
git branch -a
然后checkout
遥控器fixes_v3
给了我这个
git fetch
给我这个
以及这些东西的各种其他组合,通常从头开始,从各种 SO 问题、手册、官方文档等汇总。我什至不知道从哪里开始研究这个而不必第 n 次从头开始学习 git。
如何获取代码,fixes_v3
而不仅仅是一个命名不正确的分支fixes_v3
?
编辑请求的输出:
um@machine2:~/client$ git show-ref
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/heads/fixes_v3
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/heads/localfixesv3
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/remotes/origin/HEAD
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/remotes/origin/fixes_v3
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/remotes/origin/version3
um@machine2:~/unrollclient$ git ls-remote origin
um@machine1 password:
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 HEAD
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/heads/fixes_v3
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/heads/version3
7bd4490e8f98d29c5e82f473d1b04e542b67dec0 refs/remotes/origin/HEAD
16c7b55e2ea3e26c2f8faccd43e1c0db9620008a refs/remotes/origin/Testing
a7a5642f6766332910c2c9005e8aafaf456f1f58 refs/remotes/origin/john
7bd4490e8f98d29c5e82f473d1b04e542b67dec0 refs/remotes/origin/master
ae10bcf7e15a4e251b50e8bc2eae3e5a2bc25b63 refs/remotes/origin/version3
um@machine2:~/client$ git remote show origin
um@machine1's password:
* remote origin
Fetch URL: git+ssh://um@machine1/home/um/client
Push URL: git+ssh://um@machine1/home/um/client
HEAD branch (remote HEAD is ambiguous, may be one of the following):
fixes_v3
version3
Remote branches:
fixes_v3 tracked
version3 tracked
Local branches configured for 'git pull':
fixes_v3 merges with remote fixes_v3
localfixesv3 merges with remote fixes_v3
Local ref configured for 'git push':
fixes_v3 pushes to fixes_v3 (up to date)