Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以使用 GIT cli 来确定远程存储库中有多少个 git 分支?
很高兴看到有人在不知不觉中将我不想要的分支推送到远程存储库中。
git branch -r将列出所有已配置遥控器上的所有分支。您可能想git fetch --all先确保它是最新的。
git branch -r
git fetch --all
您可以使用git ls-remote <url/to/remote/repo.git>git 列出远程存储库中存在的所有引用。
git ls-remote <url/to/remote/repo.git>