Skip to content

Instantly share code, notes, and snippets.

@mukeshsolanki
Last active April 17, 2024 03:47
Show Gist options
  • Save mukeshsolanki/df7e3d4fc767f10700160f06f2463148 to your computer and use it in GitHub Desktop.
Save mukeshsolanki/df7e3d4fc767f10700160f06f2463148 to your computer and use it in GitHub Desktop.
My Git Config
[user]
name = Mukesh Solanki
email = me@mukeshsolanki.com
[alias]
co = checkout
cob = checkout -b
st = status
cm = commit -m
amend = commit --amend -m
pu = !git push origin `git branch --show-current`
squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
cl = log --merges --oneline --grep \"Merge pull request\" --pretty=format:'%C(yellow)%d%Creset %s - %Cred%h%Creset - %C(bold blue)<%an>%Creset'
parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
sync = "!git submodule update --recursive"
prepare-release = "!f() { \
git submodule foreach --recursive 'branch=$(git config -f $toplevel/.gitmodules submodule.$name.branch || echo \"develop\"); git checkout $branch; git pull origin $branch'; \
}; f"
review = "!f() { git branch -D $1 2>/dev/null; git fetch origin $1:$1 && git checkout $1; }; f"
[init]
defaultBranch = main
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[push]
autoSetupRemote = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment