Skip to content

Instantly share code, notes, and snippets.

@michsch
Last active September 4, 2019 12:15
Show Gist options
  • Save michsch/644419c6d85d239eb58d to your computer and use it in GitHub Desktop.
Save michsch/644419c6d85d239eb58d to your computer and use it in GitHub Desktop.
GIT alias
[alias]
co = checkout
br = branch
ci = commit
st = status
unstage = reset HEAD --
last = log -1 HEAD
graph = log --graph
amsi = commit --amend --signoff
amend = commit --amend
aamend = !git add -A && git commit --amend
# Codeschool GIT Real 2
pushall = push --recurse-submodules=on-demand
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
ec = config --global -e
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
cf = !git reset HEAD --hard && git clean -fd
# git up: only if git up isn't installed
up = !git pull --rebase --prune --autostash $@ && git submodule update --init --recursive
[pull]
rebase = true
[branch]
# old GIT versions
autosetuprebase = always
[rebase]
autostash = true
[commit]
gpgsign = true
@michsch
Copy link
Author

michsch commented Nov 25, 2014

Define an alias (git co as alias for git checkout):

git config --global alias.co checkout

@michsch
Copy link
Author

michsch commented Sep 4, 2019

Add GPG signing key:

git config --global user.signingkey 741015A8448FF602

If you don't want to type the -S flag every time you commit, you can tell Git to sign your commits automatically:

git config --global commit.gpgsign true

Source: https://gitlab.com/help/user/project/repository/gpg_signed_commits/index.md

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