Browse Source

git: Restructure aliases and config in general.

master
Nick Plekhanov 9 years ago
parent
commit
d2d4ad7fcc
  1. 78
      git/gitconfig

78
git/gitconfig

@ -1,23 +1,79 @@
# A good list of alises http://haacked.com/archive/2014/07/28/github-flow-aliases/ # A good list of alises http://haacked.com/archive/2014/07/28/github-flow-aliases/
[alias] [alias]
# Staging
a = add a = add
aa = add --all
# Branch
br = branch br = branch
branch-name = rev-parse --abbrev-ref HEAD
branch-diff = diff master...HEAD
branch-files = "!git diff master...HEAD --name-status | sed '/^D/d ; s/^.\\s\\+//'"
# Commit
c = commit c = commit
ca = commit -a ca = commit -a
cm = commit -m cm = commit -m
cal = !git add -A && git commit # Commit all changes cal = !git add -A && git commit # Commit all changes
cam = commit -am cam = commit -am
cne = commit --no-edit cne = commit --no-edit
amend = commit --amend
amend-all = !git add --all && git commit --amend --reuse-message=HEAD
# Clone
cl = clone
sclone = clone --depth=1
# Checkout
co = checkout co = checkout
cb = checkout -b
# Cherry-pick
cp = cherry-pick cp = cherry-pick
# Diff
d = diff --color-words d = diff --color-words
dc = diff --cached dc = diff --cached
df = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# Merge
m = merge
# Pull
up = pull
plom = pull origin master
plum = pull upstream master
preb = !git fetch upstream && git rebase upstream/master
# Push
p = push p = push
pom = push origin master
poh = push origin head
# Stash
st = stash
stp = stash pop
# Status/Logging
s = status s = status
ss = status -s ss = status -sb
sclone = clone --depth=1 hist = log --graph --pretty=custom # Show custom graph
up = pull l = log --pretty=custom # Show custom log
ll = log --stat --abbrev-commit
lc = shortlog --summary --numbered # List contributors
# Reset
unstage = reset HEAD -- # Mixed reset (affects HEAD and Index)
undo = reset --soft HEAD~1 # Undo last commit (affects HEAD only)
reset = reset --hard HEAD~1 # Remove last commit (from HEAD, Index and Working Dir)
# Remote
r = remote -v
# Submodules
subpl = submodule update --init --recursive
# Git flow
new = !git pull origin develop && git flow feature start new = !git pull origin develop && git flow feature start
done = !git pull origin develop && git flow feature finish "$(git symbolic-ref --short HEAD | sed -n 's/^feature\\///p')" done = !git pull origin develop && git flow feature finish "$(git symbolic-ref --short HEAD | sed -n 's/^feature\\///p')"
go = !git checkout $1 && pull go = !git checkout $1 && pull
@ -26,20 +82,9 @@
mmm = !git fetch origin master && git rebase origin/master mmm = !git fetch origin master && git rebase origin/master
ddd = !git fetch origin develop && git rebase origin/develop ddd = !git fetch origin develop && git rebase origin/develop
g = log --graph --pretty=custom # Show custom graph # Misc
l = log --pretty=custom # Show custom log
ll = log --stat --abbrev-commit
lc = shortlog --summary --numbered # List contributors
rlc = reset --hard HEAD~1 # Remove last commit (from HEAD, Index and Working Dir)
undo = reset --soft HEAD~1 # Undo last commit (affects HEAD only)
unstage = reset HEAD -- # Mixed reset (affects HEAD and Index)
publish = "!git push --set-upstream origin $(git branch-name)" publish = "!git push --set-upstream origin $(git branch-name)"
branch-name = rev-parse --abbrev-ref HEAD
branch-diff = diff master...HEAD
branch-files = "!git diff master...HEAD --name-status | sed '/^D/d ; s/^.\\s\\+//'"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Find commits by source code # Find commits by source code
@ -206,6 +251,3 @@
clean = git lfs clean %f clean = git lfs clean %f
smudge = git lfs smudge %f smudge = git lfs smudge %f
required = true required = true
[user]
name = Nick Plekhanov
email = nickatgit@yandex.com

Loading…
Cancel
Save