私はgitrepoを備えたmachine1を持っています。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)