From fd528574171e61585fd0ed6b7ea94455bbeb345d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Za=C5=82=C4=99cki?= Date: Sun, 16 Jul 2017 14:03:32 +0200 Subject: [PATCH] Add commands for removing local branches (#64) Second command comes in handy especially when you pull branches for doing QA/CR but you don't merge/delete branches. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 2fee01f..befd11a 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,14 @@ Because of most of the reasons above, we use [Feature-branch-workflow](https://w * Pull request will be accepted, merged and close by reviewer. * Remove your local feature branch if you're done. + ```sh + git branch -d + ``` + to remove all branches which are no longer on remote + ```sh + git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done + ``` + ### 1.3 Writing good commit messages