2015-07-06 15:20:24 +00:00
|
|
|
|
[alias]
|
2015-11-13 00:21:31 +00:00
|
|
|
|
## 'New' commands.
|
|
|
|
|
create-initial-commit = !git commit -m 'Initial commit' --allow-empty
|
|
|
|
|
hard-reset = !git reset --hard $(git upstream)/$(git current-branch)
|
|
|
|
|
# Assume the specified file is unchanged to stop changes
|
|
|
|
|
# being seen by Git
|
|
|
|
|
assume = update-index --assume-unchanged
|
|
|
|
|
# No longer assume a specified file remains unchanged
|
|
|
|
|
unassume = update-index --no-assume-unchanged
|
|
|
|
|
# List all files that are assumed to be unchanged
|
|
|
|
|
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 the current branch upstream to origin using the same branch
|
|
|
|
|
# name for the remote branch.
|
|
|
|
|
upstream-current-branch = !git push --set-upstream origin \
|
|
|
|
|
$(git current-branch)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
red = !git rebase-against-develop
|
|
|
|
|
rem = !git rebase-against-master
|
|
|
|
|
w = !git word-diff
|
|
|
|
|
wip = !git work-in-progress
|
|
|
|
|
|
|
|
|
|
# Shorterned existing commands.
|
|
|
|
|
a = add
|
|
|
|
|
aa = add --all --intent-to-add
|
|
|
|
|
ap = add --patch
|
|
|
|
|
au = add -u
|
|
|
|
|
b = branchs
|
|
|
|
|
bd = branch --delete
|
|
|
|
|
c = commit -v
|
|
|
|
|
ca = commit --amend
|
|
|
|
|
caa = commit --amend -C HEAD
|
|
|
|
|
cl = clone --recursive
|
|
|
|
|
co = checkout
|
|
|
|
|
cop = checkout -p
|
|
|
|
|
d = diff
|
|
|
|
|
f = fetch --all
|
|
|
|
|
g = grep --break --heading
|
|
|
|
|
l = !git log --oneline --graph --decorate -20 || true
|
|
|
|
|
m = merge --ff-only
|
|
|
|
|
nb = !git create-new-branch
|
|
|
|
|
p = push
|
|
|
|
|
rb = rebase
|
|
|
|
|
rba = rebase --abort
|
|
|
|
|
rbc = rebase --continue
|
|
|
|
|
rbi = rebase --interactive
|
|
|
|
|
s = status --short --branch
|
|
|
|
|
sb = show-branch -a
|
|
|
|
|
dt = diftool
|
2015-07-06 15:20:24 +00:00
|
|
|
|
|
2015-10-28 23:51:41 +00:00
|
|
|
|
[branch]
|
|
|
|
|
autosetupmerge = true
|
|
|
|
|
autosetuprebase = always
|
|
|
|
|
|
|
|
|
|
[color]
|
|
|
|
|
ui = true
|
|
|
|
|
|
2015-07-06 15:20:24 +00:00
|
|
|
|
[core]
|
2015-11-13 00:21:31 +00:00
|
|
|
|
# A global .gitignore file.
|
|
|
|
|
excludesFile = ~/.gitignore-global
|
2015-07-06 15:20:24 +00:00
|
|
|
|
|
2015-10-28 23:51:41 +00:00
|
|
|
|
[diff]
|
|
|
|
|
tool = vimdiff
|
2015-07-06 15:20:24 +00:00
|
|
|
|
|
|
|
|
|
[fetch]
|
2015-11-13 00:21:31 +00:00
|
|
|
|
# Always prune when fetching (and pulling).
|
|
|
|
|
prune = true
|
2015-07-06 15:20:24 +00:00
|
|
|
|
|
2015-10-28 23:51:41 +00:00
|
|
|
|
[gitsh]
|
2015-11-13 00:21:31 +00:00
|
|
|
|
nogreeting = true
|
2015-10-28 23:51:41 +00:00
|
|
|
|
|
|
|
|
|
[grep]
|
|
|
|
|
# Show the line numbers in the output.
|
|
|
|
|
lineNumber = true
|
|
|
|
|
|
2015-07-06 15:20:24 +00:00
|
|
|
|
[help]
|
2015-11-13 00:21:31 +00:00
|
|
|
|
autocorrect = 1
|
|
|
|
|
# Open Git help pages in a browser as HTML.
|
|
|
|
|
format = web
|
2015-07-06 15:20:24 +00:00
|
|
|
|
|
2015-10-28 23:51:41 +00:00
|
|
|
|
[include]
|
|
|
|
|
path = ~/.gitconfig-local
|
2015-10-26 20:54:35 +00:00
|
|
|
|
|
|
|
|
|
[rebase]
|
2015-10-28 23:51:41 +00:00
|
|
|
|
autosquash = true
|
|
|
|
|
autostash = true
|
|
|
|
|
|
|
|
|
|
[rerere]
|
|
|
|
|
# Store and re-use manual conflict resolution changes.
|
2015-10-28 23:52:47 +00:00
|
|
|
|
enabled = true
|