Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Cleaning up GIT after a successful PR merge
- ## Deleting from github
- * Navigate to the closed PR
- * Scroll down to the bottom of the PR page until you see "Pull request successfully merged and closed"
- * Click on "Delete branch"
- ## Cleaning local git environment
- Make sure to check out the development branch and retrieve changes from remote first:
- ```
- git checkout development
- git pull
- ```
- Then proceed to remove local and remote branch references from your local environment.
- Start by removing any local branches that have been deleted after a merge:
- ```
- git branch --merged | egrep -v "(^\*|master|dev|development)" | xargs git branch -d
- ```
- Then perform a dry-run of git-prune to ensure that the only references being removed are of remote branches that have been deleted after a merge:
- ```
- git remote prune origin --dry-run
- ```
- If all the branches listed are safe to be removed, perform the command above without any flags:
- ```
- git remote prune origin
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement