Skip to content

Instantly share code, notes, and snippets.

@janoka
Created February 23, 2017 12:39
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 janoka/001a793ce66d01553289b47e1aa76463 to your computer and use it in GitHub Desktop.
Save janoka/001a793ce66d01553289b47e1aa76463 to your computer and use it in GitHub Desktop.
[user]
name =
email =
[color]
ui = true
[alias]
# See: http://stackoverflow.com/questions/7066325/how-to-list-show-git-aliases
# General aliases =====
h = help # ... general help from git commands
# la = "!grep ' =' ~/.gitconfig | sed -e 's/=/\\x1b[0;31m=\\x1b[0m/g' | sed -e 's/#.*/\\x1b[0;32m&\\x1b[0m/g' | less -R"
la = "!grep ' =' ~/.gitconfig | less -R"
# Initial commit =====
i = !git init && git add . && git c 'Initial commit.'
# Status =====
s = status
ss = status -uno
# Actual files in the HEAD =====
lsf = !git ls-tree HEAD --full-tree -r -t --name-only | less
lsfd = !git ls-tree HEAD --full-tree -r -t -d --name-only | less
ls = ls-tree -r --name-only # ... SHA1
lsd = ls-tree -r -t -d --name-only # ... SHA1
lsfa = !git ls-tree HEAD --full-tree -r -t -l --abbrev=4 | less
lsfad = !git ls-tree HEAD --full-tree -r -t -l -d --abbrev=4 | less
lsfav = !git ls-tree HEAD --full-tree -r -t -l --abbrev=7 | less
lsfadv = !git ls-tree HEAD --full-tree -r -t -l -d --abbrev=7 | less
# Stashing =====
st = stash
stl = stash list
stp = stash pop
sta = stash apply
# Addig files =====
a = add # ... add file(s)
aa = add . # add the current folder to commit.
ai = add -i # interactive adding
ap = add -p # check the addig by chunks.
# Removig =====
rm = rm -r # ... removing something from repo, -r: recursive
rmc = rm -r --cached # ... remove a file from repo, but the current files are not tuched
# Commiting =====
c = commit -m # giving a message
fc = commit -a -m "Fast commit" # fast commit
ca = commit -a -m # commit with the new modified files
mc = commit # 'message commit' you can edit in an editor the message
mca = commit -a # 'message commit' new files
cam = commit --amend -C HEAD # last commit update, if you not push to remote repository
# Undo (reset) =====
r = reset --hard HEAD # Undo the file's changes from the last commit.
rv = revert HEAD #
# Branches =====
b = branch # Chose a branch or display the branches.
co = checkout # Checkout.
bc = checkout -b # Create a branch and checkout it.
bd = branch -d # Delete a branch
fb = !git st && git b #
m = merge --no-ff # Merge a branch, using all commits.
rb = rebase # Rebase a branch.
rbi = rebase -i
rbc = rebase --continue
rbs = rebase --skip
rba = rebase --abort
# Remote repository =====
pp = pull
p = push
rmrb = push --delete origin # Remote branch deleting.
#fp = !git mca && git p # Quick push
f = fetch # Fetching a remote.
rem = remote -v # Show the remotes.
rp = remote prune origin # Prune the old repos from local.
# Log and history =====
rl = reflog
l = log --all --graph --oneline --decorate=short
ll = log --all --graph --abbrev-commit --decorate=short --pretty=short
lll = log --all --graph --abbrev-commit --decorate=short --pretty=medium
lo = log --all --graph --oneline --decorate=short --abbrev=7
llo = log --all --graph --abbrev=7 --decorate=short --pretty=short
lllo = log --all --graph --abbrev=7 --decorate=short --pretty=medium
ci = commit -a
aa = add --all
create-pull-request = !sh -c 'stash pull-request $0'
[core]
quotepath = false
autocrlf = input
editor = vim
excludesfile = /Users/janoka/.gitignore_global
[auto]
ui = true
[credential]
helper = git-credential-osxkeychain
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[push]
default = simple
[gc]
auto = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment