Reputation: 150263
I'm trying to alias the command:
git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d
This is my .gitconfig
file:
[credential]
helper = wincred
[user]
name = Doron Grinzaig
email = [email protected]
[push]
default = simple
[alias]
db = git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
unstage = reset HEAD --
But now when I try to edit the .gitconfig file I get the error:
$ git config --global --edit
fatal: bad config file line 9 in C:\Users\Doron Grinzaig/.gitconfig
I was told I need to use !
for running bash scripts as git alias, but the following returned the same error:
[alias]
db = !git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
I'm using git bash for windows.
Upvotes: 7
Views: 2103
Reputation: 994
Try escaping the quotes and backslash in the first grep command:
[alias]
db = !git branch --merged | grep -v \"\\*\" | grep -v master | grep -v dev | xargs -n 1 git branch -d
Upvotes: 12