Gangmax Blog

自由之思想,独立之精神

Remove Local, Remote Branch and Outdated References

| Comments

  • Remove local and remote branch

From here.

1
2
3
# Before doing this, make sure all the changes ARE MERGED!
git push origin --delete <branch_name>
git branch -d <branch_name>
  • Clear the outdated references

The local repo’s remote branches will be outdated if you remove the corresponding branch in Gitlab after merging a merge request. If this happens, use the following command in your local repo to clear the outdated references:

From here.

1
git remote prune origin

Comments