2

SVNリポジトリをGitに移動しましたが、おそらく多くのクローン作成が原因で、次のようなブランチがたくさん残っています。

BranchA
origin/BranchA
remotes/BranchA
remotes/origin/BranchA
remotes/origin/origin/BranchA

つまり、同じブランチが何度もリストされます。どうすればこの混乱をクリーンアップできますか。50を超えるブランチがあり、一部はまったく必要ありません。残りのブランチは、一度だけ持っていれば満足です。

編集:

これは、特定の場合のgit remoteshoworiginがどのように見えるかです。

Remote branches:
BranchA tracked
origin/BranchA tracked

..。

Local branches configured for 'git pull':
origin/BranchA merges with remote BranchA

..。

Local refs configured for 'git push':
BranchA pushes to BranchA (up to date)
origin/BranchA pushes to origin/BranchA (up to date)
4

1 に答える 1

5

次のコマンドを使用して、これらのブランチを削除できます。

git push origin :branch_name

BranchAブランチを削除するには:

git push origin :BranchA

origin/BranchAブランチを削除するには:

git push origin :origin/BranchA

または、などを使用することもできますgit branch -dr BranchA

BranchAおよびを除くすべてのブランチを削除しorigin/BranchAます。リモコンを削除した可能性がありoriginます。その場合は、リモコンを削除して、リモコンremotesとして再度追加する必要がありますorigin

于 2010-09-28T06:39:36.210 に答える