If I check my local git branches.
$ git branch
local-feat-18.3-APPLE-1854-20180227
local-feat-18.3-APPLE-1854-20180227#1
local-feat-18.3-APPLE-1854-20180228
local-feat-18.3-APPLE-1854-20180228#1
local-feat-18.3-APPLE-1899-20180320
local-feat-18.3-APPLE-1899-20180320#1
local-feat-18.3-APPLE-1899-20180320#2
local-feat-18.3-APPLE-1899-20180330
local-feat-18.3-APPLE-1899-20180330#1
local-feat-18.3-APPLE-1921-20180402
local-feat-18.3-APPLE-1921-20180402#2
local-feat-18.3-APPLE-1921-20180402#3
After deletion, it will look like below:
$ git branch
local-feat-18.3-APPLE-1899-20180320
local-feat-18.3-APPLE-1899-20180320#1
local-feat-18.3-APPLE-1899-20180320#2
local-feat-18.3-APPLE-1899-20180330
local-feat-18.3-APPLE-1899-20180330#1
local-feat-18.3-APPLE-1921-20180402
local-feat-18.3-APPLE-1921-20180402#2
local-feat-18.3-APPLE-1921-20180402#3
Would you please help me to fix the issue. Thanks in advance for your kind support.
I don't consider, is it merged or not. I have go through stackoverflow. I got some suggestions like below, but not satisfied.
To delete every branch except the one that you currently have checked out:
for b in `git branch --merged | grep -v \*`; do git branch -D $b; done
The simpler way to delete all branches but keeping others like "develop" and "master" is the following:
git branch | grep -v "develop" | grep -v "master" | xargs git branch -D
Resource Link: Delete all local git branches