Clean Local Git Repository

阅读 65

2022-04-29

Clean Local Git Repository

Keeping your local repository clean is helpful to development work.

1. Clean Rubbish

$ git gc
$ git prune

2. Clean the branches that are no longer in the remote repository

$ git remote prune origin

3. Clean the tags that are no longer in the remote repository

$ git fetch origin --prune --prune-tags --force

or

$ git tag -d $(git tag)
$ git fetch --tags

Ref:

  • Remove local git tags that are no longer on the remote repository

相关推荐

精彩评论(0)

0 0 举报