1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Git】git pullした際に自動でpruneする方法

Last updated at Posted at 2022-12-16

git pull --prune

git pull --pruneを実行することで削除済みのリモートブランチをローカルに反映できます。

git pull --prune

またgit fetchでも同様のことが可能です。

常に--pruneする

git pullgit fetchの際に常にpruneするには以下のコマンドを実行してGitの設定を追加します。

git config --global fetch.prune true

現在のリポジトリのみに設定するには以下のコマンドを実行します。

git config --local fetch.prune true
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?