LoginSignup
0
0

More than 1 year has passed since last update.

リモート追跡ブランチから不要なブランチを削除する [git fetch --prune]

Posted at

やりたいこと

例えば、developブランチにマージ済みのブランチfeature/add-featureがGitHub上にあるとする。

マージ済みなので、ブランチfeature/add-featureをリモートから削除した。

ただ、リモート追跡ブランチには残っている。もう不要なので消したい。

bash
git branch -a
* develop
  main
  remotes/origin/develop
  remotes/origin/main
  remotes/origin/feature/add-feature  // こいつ

git fetch --pruneを使う

Gitコマンドgit fetch --pruneはリモートに存在しなくなったブランチを
リモート追跡ブランチから削除してくれる。

無事削除された。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0