Skip to content

Instantly share code, notes, and snippets.

@sounisi5011
Last active January 23, 2019 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sounisi5011/edd2f6b2dca0e87e3509c943d91deccf to your computer and use it in GitHub Desktop.
Save sounisi5011/edd2f6b2dca0e87e3509c943d91deccf to your computer and use it in GitHub Desktop.
git pullですべてのブランチをリモートと同期するコマンド
# Note: リモートから削除されたブランチは自分で消す必要がある
# リモートブランチすべてをループ処理する
git fetch -p && git branch -r | while read remote; do
# ブランチを切り替える
echo "> $ git checkout ${remote#origin/}"
git checkout "${remote#origin/}"
echo
# ブランチをpullする
echo "> $ git pull origin ${remote#origin/}"
git pull origin "${remote#origin/}"
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment