0
対Gitのブランチ-a postコマンドは、リモートブランチに関連して、同じ出力を生成する必要があります後は、しかしリストリモートブランチ - GitのLS-リモート--heads原点
git fetch
git branch -a
見えしばらくされていないリモートの支店を示し実行中
git ls-remote --heads origin
この動作の理由は何ですか?
[明確化]あなたのマシン上で、ローカルに存在し、どちらもgit branch -a
リストすべてのローカルおよび追跡の枝を、実行
(TA216441) $ git pull
Your configuration specifies to merge with the ref 'refs/heads/TA216441'
from the remote, but no such ref was fetched.
(TA216441) $ git fetch
(TA216441) $ git branch -a
* TA216441
TA216442
master
remotes/origin/HEAD -> origin/master
remotes/origin/TA212425
remotes/origin/TA216441
remotes/origin/TA219346
remotes/origin/TA220305
remotes/origin/TA223738
remotes/origin/master
(TA216441) $ git ls-remote --heads origin
hash-1 refs/heads/DE18756_2
hash-2 refs/heads/TA212425
hash-2 refs/heads/TA219346
hash-3 refs/heads/TA220305
hash-4 refs/heads/master
枝が削除されたようですが、git branch -aは実際に枝がリモートに存在するかどうかをチェックしません。 –
@BartekWichowski:正しい: 'git branch -a'はローカルで動作し、別のGitには決して接触しません。 'git ls-remote'は他のGitを呼び出し、それに質問します。もしあなたが好きであれば、 'git fetch --prune origin'を実行して、Gitが' origin'でGitを呼び出し、新しいコミットをダウンロードし、あなたのローカルコピーを更新し、これを "prune"あなたが持っていないブランチに対して持っている遠隔追跡ブランチを部分的に*削除*します。つまり、あなたの 'origin/*'遠隔追跡ブランチを「剪定」します。 – torek
@BartekWichowski(続き)デフォルトで* *を実行したい場合は、その設定があります。 [prune]という単語について[git config'のドキュメント(https://www.kernel.org/pub/software/scm/git/docs/git-config.html)を検索してください。 – torek