Removing alias commands in gitconfig files

I am trying to add the alias command to my gitconfig file and it reports a β€œbad configuration file” in the line I added. I suspect this has something to do with the sed command and some escaping issues, but I don't know exactly what it should be. Here's a line extension command added for readability:

 impact = !git ls-files -z | xargs -0n1 git blame -w -C | sed -r 's/^[^(]+\((.*) [0-9]{4}-.*/\1/' | sed -r 's/ +$//' | sort -f | uniq -c | sort -nr 
+7
source share
1 answer

I suspect this is a " \ " that needs to be doubled.

I tried my alias with ' \\ ' without error message.

 impact = !git ls-files -z | xargs -0n1 git blame -w -C | sed -r 's/^[^(]+\\((.*) [0-9]{4}-.*/\\1/' | sed -r 's/ +$//' | sort -f | uniq -c | sort -nr 
+8
source

All Articles