Created
March 8, 2024 11:30
-
-
Save akaralar/fb1a4472b2aac3c096057e2f6310a6b2 to your computer and use it in GitHub Desktop.
Sort gitconfig file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from https://blog.wotw.pro/sort-git-config/ | |
# the options for each property need to be indented using a single tab beforehand... | |
cat ~/.config/git/config | sed 's/ +/\t/g' | awk -F '\t' '$1 { current = $1; print current } $2 { print current "\t" $2}' | sort | awk -F '\t' '!$2 {print $1} $1 && $2 { print "\t" $2 }' | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment