将本地所有分支推送到远程

准备:

  • 手动将所有分支签出到本地存储库(签出所有分支的脚本如下所示),
  • git push origin '*:*'

用于将所有分支检出到本地存储库的 .sh 脚本:

for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
   git branch --track ${branch#remotes/origin/} $branch
done
posted @ 2022-11-03 16:51  Kconfig  阅读(60)  评论(0编辑  收藏  举报