Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
147 lines (123 sloc) 3.96 KB
[include]
path = ~/.dotfiles/.gitconfig.private
[core]
editor = nano
[alias]
# List aliases
aliases = config --get-regexp alias
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# My life is full of typos
ad = add
cinnut = commit -s
cmit = commit -s
cmmit = commit -s
cmomit = commit -s
cmt = commit -s
comimt = commit -s
comit = commit -s
comit = commit -s
comkmit = commit -s
commi = commit -s
commt = commit -s
dif = diff
dff = diff
dfi = diff
df = diff
lo = log
lgo = log
lof = log
loh = log
ocmit = commit -s
ocmmit = commit -s
og = log
omit = commit -s
ommit = commit -s
satus = status
sta = status
st = status
stat = status
stats = status
statsu = status
statu = status
stts = status
sttus = status
pusj = push
pus = push
# Pretty useful
ci = !hub ci-status
push = origin $(git symbolic-ref --short HEAD)
pushf = push -f
# Life saver
# Put any file changed up for commits
addr = "!fnc(){ git add $(git status | $(which grep) "modified:" | cut -f2 -d ":" | xargs); }; fnc"
pushd = "!fnc() { \
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD); \
git push origin ${BRANCH_NAME}; \
read -p 'Enter [y/n] if you want to create a PR: ' response; \
if [ \"${response}\" != \"${response#[Yy]}\" ]; then hub pull-request --no-edit; fi \
};fnc"
# Create pull request on GitHub to devel remote branch if it exists else, to master
create-pr = "!f() { \
REMOTE="devel"; \
if ! git show-ref --quiet refs/heads/devel; then REMOTE="master"; fi; \
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD); \
git push -u origin "${BRANCH_NAME}"; \
hub pull-request -b "${REMOTE}" -h "${BRANCH_NAME}" --no-edit; \
};f"
# Merge GitHub pull request on top of the current branch or,
# if a branch name is specified, on top of the specified branch
merge-pr = "!f() { \
declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
declare branch=\"${2:-$currentBranch}\"; \
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
git fetch origin refs/pull/$1/head:pr/$1 && \
git checkout -B $branch && \
git rebase $branch pr/$1 && \
git checkout -B $branch && \
git merge pr/$1 && \
git branch -D pr/$1 && \
git commit --amend -s -S -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
fi \
}; f"
clone = clone --progress
# Show the diff between the latest commit and the current state
diff-previous = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# Clone a repository including all submodules
clone-rec = clone --recursive --progress
# Switch to a branch, creating it if necessary and if it exist pull latest changes
goto = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\" && bash -c 'git pull -f & >/dev/null 2>&1'; }; f"
# Need I say more
commit-amend = "!fnc() { \
echo "Amending to previous commit with HEAD commit msg!"; echo; \
git commit -s --amend -anC HEAD; \
};fnc"
commit-amend-push = "!fnc() { \
echo "Amending to previous commit with HEAD commit msg!"; echo; \
git commit -s --amend -anC HEAD; \
git push -f; \
};fnc"
last = log -1 HEAD
commit = commit -s
[color]
ui = auto
branch = auto
diff = auto
interactive = auto
status = auto
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[push]
default = current
[http]
sslVerify = false
[credential]
helper = store
[init]
templatedir = /home/mmphego/GitHub/git-hooks/
[commit]
gpgsign = true
signoff = true
You can’t perform that action at this time.