Skip to content

Instantly share code, notes, and snippets.

@billbonney
Last active July 27, 2023 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billbonney/adc2ad736878c2a54fbf2c7604fcd062 to your computer and use it in GitHub Desktop.
Save billbonney/adc2ad736878c2a54fbf2c7604fcd062 to your computer and use it in GitHub Desktop.
gitconfig shortcuts and default settings
#
# .gitconfig with simple shortcuts for common actions
#
[user]
name = <your.name>
email = <your.email>
[alias]
br = branch
ci = commit
co = checkout
cp = cherry-pick
fa = fetch --all
# Add --graph and --all for more detail eg. git logs --graph
logs = log -n15 --date=short --pretty='format:%C(green)%ad %C(yellow)%h%Creset %C(cyan)%aN%Creset %s%C(magenta bold)%d%Creset'
logg = logs --graph
loga = logs --all --graph
me = merge
mf = merge --ff-only
fod = fetch origin develop
fud = fetch upstream develop
fom = fetch origin master
fum = fetch upstream master
rod = rebase origin develop
rom = rebase origin master
po = pull --ff-only origin
poc = pull --tags --ff-only origin candidate
pod = pull --tags --ff-only origin develop
pom = pull --tags --ff-only origin master
pob = pull --ff-only origin $(git symbolic-ref --short HEAD)
pu = pull --tags --ff-only upstream
pum = pull --tags --ff-only upstream master
#
# Used with gerrit
#
pu4d = push origin HEAD:refs/for/develop
pu4m = push origin HEAD:refs/for/master
rem = remote -v
st = status
sm = submodule
[push]
default = simple
[color]
ui = true
[core]
pager = less -F -X
excludesfile = ~/.gitignore
[merge]
conflictstyle = diff3
[init]
defaultBranch = develop
[pull]
rebase = true
[blame]
ignoreRevsFile = .git-blame-ignore-revs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment