Skip to content

Instantly share code, notes, and snippets.

@danielrobertson
Last active June 12, 2021 22:26
Show Gist options
  • Save danielrobertson/aeb6a1cfaa06380449a6 to your computer and use it in GitHub Desktop.
Save danielrobertson/aeb6a1cfaa06380449a6 to your computer and use it in GitHub Desktop.
.gitconfig
[user]
name = Daniel Robertson
email = danielrobertson733@gmail.com
[alias]
p = pull
a = add
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
redev = !git fetch origin develop && git rebase origin/develop
remaster = !git fetch origin master && git rebase origin/master
remain = !git fetch origin main && git rebase origin/main
[url "git@github.com:"]
insteadOf = https://github.com/
[push]
default = current
@danielrobertson
Copy link
Author

Drop this into your ~/.gitconfig file

@danielrobertson
Copy link
Author

Also useful, drop this in your ~/.bash_profile to get the branch name for git repo's in your PS1 prompt:

parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\w\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ "```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment