42
38

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 5 years have passed since last update.

git fetchしたときにremoteに存在しないbranchはlocalでも削除する

Posted at

ふつうgit fetchでは他人が削除したremoteのブランチを消してくれないが、

% git fetch -p

とすればローカルのブランチをremoteに合わせて、remoteで消されてるものはローカルでも削除する、という動きをする。

% git fetch --help

 -p, --prune  
 After fetching, remove any remote-tracking branches which no longer exist on the remote. 
42
38
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
42
38

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?