LoginSignup
42
38

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