gitconfig: organise aliases

This commit is contained in:
Oliver Davies 2015-10-29 02:12:45 +00:00
parent a6152fae0b
commit 26aaab5242

View file

@ -1,52 +1,7 @@
[alias] [alias]
aa = add --all ## 'New' commands.
ap = add --patch
b = branch -v
bv = branch -vv
bd = branch -d
c = commit -v
ca = !git c --amend
caa = !git ca -a -C HEAD
cam = !git c -am
cf = commit --fixup
cl = clone
cm = !git c -m
co = checkout
cop = checkout -p
ds = diff --stat
f = fetch
g = grep --break --heading --line-number
create-initial-commit = !git commit -m 'Initial commit' --allow-empty create-initial-commit = !git commit -m 'Initial commit' --allow-empty
l = log --oneline --graph --decorate hard-reset = !git reset --hard $(git upstream)/$(git current-branch)
la = !git l --all
noff = merge --no-ff
prb = pull --rebase
ra = rebase --abort
ri = rebase --interactive
rc = rebase --continue
s = status --short --branch
staged = diff --staged
undo = reset --hard
unstage = reset HEAD --
wipe = clean -fd
word-diff = diff --word-diff
# Print the name of the current branch.
current-branch = symbolic-ref --short HEAD
# Print the name of the current upstream tracking branch.
upstream = !git config --get branch.$(git current-branch).remote \
|| echo origin
# Checkout the latest develop branch and update it.
pull-develop = !git checkout develop && git pull --rebase
# Checkout the latest master branch and update it.
pull-master = !git checkout master && git pull --rebase
# Update the develop, master and current branches.
pull-develop-master-current-branch = !BRANCH=$(git current-branch) && \
git fetch --all && git pull-develop && git pull-master && \
git checkout $BRANCH && git pull
# Fetch and merge the latest changes from the develop branch.
merge-origin-develop = !git fetch origin && git merge origin/develop
# Fetch and merge the latest changes from the master branch.
merge-origin-master = !git fetch origin && git merge origin/master
# Assume the specified file is unchanged to stop changes # Assume the specified file is unchanged to stop changes
# being seen by Git # being seen by Git
assume = update-index --assume-unchanged assume = update-index --assume-unchanged
@ -54,12 +9,69 @@
unassume = update-index --no-assume-unchanged unassume = update-index --no-assume-unchanged
# List all files that are assumed to be unchanged # List all files that are assumed to be unchanged
assumed = !git ls-files -v | grep '^[hsmrck?]' | cut -c 3- assumed = !git ls-files -v | grep '^[hsmrck?]' | cut -c 3-
work-in-progress = commit -a -m 'WIP'
# Create a new branch.
create-new-branch = checkout -b
# Add a commit that fixes another (to be used with `rebase -i`).
fixup = commit --fixup
noff = merge --no-ff
staged = diff --staged
undo = reset --hard
unstage = reset HEAD --
wipe = clean -fd
word-diff = diff --word-diff
# Print the name of the current branch.
current-branch = symbolic-ref --short HEAD
# Print the name of the current upstream tracking branch.
upstream = !git config --get branch.$(git current-branch).remote \
|| echo origin
# Checkout the latest develop branch and update it.
pull-develop = !git checkout develop && git pull --rebase
# Checkout the latest master branch and update it.
pull-master = !git checkout master && git pull --rebase
# Update the develop, master and current branches.
pull-develop-master-current-branch = !BRANCH=$(git current-branch) && \
git fetch --all && git pull-develop && git pull-master && \
git checkout $BRANCH && git pull
push-current-branch = !git push -u $(git upstream) $(git current-branch) push-current-branch = !git push -u $(git upstream) $(git current-branch)
# Shorter commands. rebase-against-master = !git fetch --all \
&& git rebase $(git upstream)/master
rebase-against-develop = !git fetch --all \
&& git rebase $(git upstream)/master
## Shorterned 'New' commands.
cic = !git create-initial-commit cic = !git create-initial-commit
mod = !git merge-origin-develop red = !git rebase-against-develop
mom = !git merge-origin-master rem = !git rebase-against-master
w = !git word-diff
wip = !git work-in-progress
# Shorterned existing commands.
aa = add --all
ap = add --patch
b = branch -v
bv = branch -vv
bd = branch -d
c = commit -v
ca = commit --amend
caa = commit --amend -C HEAD
cl = clone --recursive
co = checkout
cop = checkout -p
f = fetch
fa = fetch --all
g = grep --break --heading --line-number
l = !git log --oneline --graph --decorate -20 || true
nb = !git create-new-branch
s = status --short --branch
[branch] [branch]
autosetupmerge = true autosetupmerge = true