Skip to content

Instantly share code, notes, and snippets.

@ch3ric
Last active November 6, 2023 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ch3ric/f8e6d20c92017f28d462 to your computer and use it in GitHub Desktop.
Save ch3ric/f8e6d20c92017f28d462 to your computer and use it in GitHub Desktop.
Git config and bashrc
# colored prompt with git branch
PS1='[\[\033[1;32m\]\u@\h\[\033[0m\]][\[\033[1;33m\]\w\[\033[0m\]]$(__git_ps1 "[\[\033[1;31m\]%s\[\033[0m\]]")\$ '
[user]
name = XXX
email = xxx@xx.xx
[color]
branch = auto
diff = auto
status = auto
interactive = auto
[alias]
st = status --short --branch
ci = commit
co = checkout
br = branch -a
cob = checkout -b
f = fetch --all
po = pull origin
por = pull --rebase origin
d = diff
please = push --force-with-lease
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset%s %Cgreen(%an %cr)%Creset' --abbrev-commit --date=relative
logfull = log --pretty=fuller --graph --stat -p
cat = cat-file -p
unstage = reset HEAD
uncommit = update-ref HEAD HEAD^
uncommithard = reset --hard HEAD^
undomerge = reset --hard ORIG_HEAD
oups = commit -a --amend -C HEAD
amend = commit --amend --no-edit
[core]
excludesfile = ~/.gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment