Last active
November 24, 2024 19:53
-
-
Save karl-gustav/708513a8b7f4893ff0acdbfb2f47914e to your computer and use it in GitHub Desktop.
My git setup
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
git config --global init.defaultBranch main | |
git config --global alias.clone 'clone' | |
git config --global alias.br 'branch' | |
git config --global alias.st 'status' | |
git config --global alias.co 'checkout' | |
git config --global alias.ci 'commit' | |
git config --global alias.pr 'pull --rebase' | |
git config --global alias.pa 'pull --abort' | |
git config --global alias.rc 'rebase --continue' | |
git config --global alias.rs 'rebase --skip' | |
git config --global alias.ra 'rebase --abort' | |
git config --global alias.ma 'merge --abort' | |
git config --global alias.mc 'merge --continue' | |
git config --global alias.cp cherry-pick | |
git config --global alias.poop "stash pop" | |
git config --global alias.ae 'commit --amend --no-edit' | |
git config --global alias.ls 'ls-tree --full-tree -r HEAD' | |
git config --global alias.fix 'reset --hard @{upstream}' | |
git config --global alias.hist '!git --no-pager log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short --max-count=10' | |
git config --global alias.sort 'for-each-ref --sort=committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))"' | |
git config --global alias.thist '!git --no-pager log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=format:"%Y-%m-%d %H:%M" --max-count=10' | |
git config --global alias.save '!git add -A && git commit -m "WIP SAVEPOINT"' | |
git config --global alias.broken '!git add -A && git commit -m "BROKEN WIP SAVEPOINT (Something does not work in this commit)"' | |
git config --global alias.sur 'submodule update --init --recursive' | |
git config --global alias.ssr 'submodule status --recursive' | |
git config --global alias.standup 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short --since="24 hours ago" --branches' | |
git config --global alias.vendor '!f() { git submodule add git@$(echo $1 |sed 's/\\//:/').git vendor/$1; }; f' | |
git config --global alias.done '!f() { if [[ ! -z "$1" ]]; then git checkout $1 && git branch -D @{-1}; else echo Branch name can not be empty; fi;}; f' | |
git config --global alias.ff '!git diff-index --quiet HEAD -- && git fetch && git reset --hard @{upstream} || echo Aborting because of unstaged changes...' | |
git config --global alias.search 'log -p --all -S' | |
git config --global alias.regex 'log -p --all -G' | |
git config --global alias.contains 'branch -a --contains' | |
git config --global alias.pf "push --force-with-lease" | |
git config --global --replace-all core.pager "less -F -X" | |
git config --global --add merge.ff false | |
git config --global remote.origin.prune true | |
git config --global clean.requireForce false | |
git config --global push.default simple | |
git config --global pull.rebase true | |
git config --global submodule.recurse true | |
git config --global --add --bool push.autoSetupRemote true | |
git config --global rebase.autosquash true | |
git config --global commit.verbose true | |
sudo git config --system core.untrackedCache true | |
git config --global color.ui true | |
git config --global color.diff-highlight.oldNormal "red bold" | |
git config --global color.diff-highlight.oldHighlight "red bold 52" | |
git config --global color.diff-highlight.newNormal "green bold" | |
git config --global color.diff-highlight.newHighlight "green bold 22" | |
git config --global color.diff.meta "11" | |
git config --global color.diff.frag "magenta bold" | |
git config --global color.diff.commit "yellow bold" | |
git config --global color.diff.old "red bold" | |
git config --global color.diff.new "green bold" | |
git config --global color.diff.whitespace "red reverse" | |
echo -e "\n# ᐃᐃᐃ If this commit is applied, it will... ---------------72 chars----|\n# ᐃᐃᐃ What is this ? Why was this change made? ---------------------80 chars----|" > ~/.gitmsg && git config --global commit.template ~/.gitmsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kdiff3 Diff/Merge Tool
git config --global diff.tool kdiff3
git config --global difftool.prompt false
git config --global merge.tool kdiff3
git config --global mergetool.prompt false
git config --global mergetool.keepBackup false
git config --global mergetool.keepTemporaries false
p4merge Diff/Merge Tool
git config --global diff.tool p4merge
git config --global difftool.p4merge.path '/Applications/p4merge.app/Contents/MacOS/p4merge'
git config --global difftool.prompt false
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path '/Applications/p4merge.app/Contents/MacOS/p4merge'
git config --global mergetool.prompt false
git config --global mergetool.keepBackup false
git config --global mergetool.keepTemporaries false