diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/gitconfig | 115 | ||||
-rw-r--r-- | base/zsh/aliases.zsh | 6 |
2 files changed, 118 insertions, 3 deletions
diff --git a/base/gitconfig b/base/gitconfig new file mode 100644 index 0000000..1221589 --- /dev/null +++ b/base/gitconfig @@ -0,0 +1,115 @@ +[user] + name = Adam Hovorka + email = [email protected] + #signingkey = +[github] + user = adamhovorka +[url "https://github.com/"] + insteadOf = gh: +[url "https://gist.github.com/"] + insteadOf = gist: +[url "https://gitlab.com/"] + insteadOf = gl: +[url "https://bitbucket.org/"] + insteadOf = bb: +[url "git.ahov.co:"] + insteadOf = ahov: + +[core] + editor = vim + excludesfile = ~/.gitignore_global +[credential] + helper = cache --timeout 3600 +[merge] + tool = vimdiff +[push] + default = simple +#[pull] +# ff = only +#[rerere] +# enabled = 1 +# autoupdate = 1 +#[status] +# submoduleSummary = true + +[color] + ui = true +[color "branch"] + current = yellow reverse + local = green + remote = red +[color "diff"] + meta = black bold + frag = magenta + old = red + plain = white + new = green + whitespaces = red reverse +[color "status"] + added = green + changed = yellow + untracked = red + +[alias] + this = !bash -c 'git root &>/dev/null && echo "Already a git repository" || (git init && git add . && git commit -m \"Initial commit\")' + root = rev-parse --show-toplevel + cloner = clone --recursive + rv = remote -v + + h = "!f() { git log $* | grep '^commit ' | cut -d' ' -f2; }; f" # Return a list of commit SHA1s + details = log -n1 -p --format=fuller # View the log and diff for a commit (previous if no SHA1 provided) + churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' + l = log --graph --topo-order --boundary --date=short --pretty='%>|(14) %C(1)%h%Creset %C(2)%cd%Creset %<(20)%C(4)%an%Creset │ %s%C(16)%d%Creset' + la = !git l --all + ll = log --decorate --stat + lp = log --patch + d = diff # Current vs added + dc = diff --cached # Added vs committed + + b = checkout -b + co = checkout + com = checkout master + pullr = pull --rebase + ra = rebase --abort + rc = rebase --continue + squash = rebase -i + br = branch -a + bv = branch -av + bd = branch -d + + fetchp = fetch --prune + fetcha = fetch --all + mergef = merge --ff-only + + s = stash # --keep-index || -u [-a] || --patch (interactive) + sl = stash list + sp = stash push + sd = stash drop + sa = stash apply + sb = stash branch + poop = stash pop + + rmd = !git ls-files -z --deleted | xargs -0 git rm # Remove deleted files + addremove = !git rmd && git add . --all # Add and remove all changes + hard = reset --hard origin/master + unstage = reset HEAD -- + + pushallmaster = !git remote | xargs -L1 -I REMOTE git push REMOTE master + pushm = !git pushallmaster + pushf = push --force-with-lease # safe force pushing + pushfm = !git pushm --force-with-lease + + export = archive -o latest.tar.gz -9 --prefix=latest/ # Save a repo as a tarball; git export master + amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend # Same message, but include more added files + trim = !git reflog expire --expire=now --all && git gc --prune=now # Thin out older metadata, reduce filesystem footprint + + spull = !git pull && git submodule sync --recursive && git submodule update --init --recursive + sspull= !git pull && git submodule update --init --recursive --remote + sfetch = submodule foreach 'git fetch --all' + + brlocaloneline = !git branch | grep -v \\* | xargs + brdeletelocal = !git branch -D `git brlocaloneline` || echo "Nothing to delete" + brallfromremotes = !git branch -a | grep 'remotes/' | grep -v "HEAD" | sed 's/remotes\\///' + brcreatefromremotes = !git brallfromremotes | xargs git branch + sync = !git checkout master && git brdeletelocal && git fetch --all + # https://stackoverflow.com/questions/10610327/delete-all-local-git-branches#10610669 diff --git a/base/zsh/aliases.zsh b/base/zsh/aliases.zsh index 0efcbd9..ccca0b2 100644 --- a/base/zsh/aliases.zsh +++ b/base/zsh/aliases.zsh @@ -35,10 +35,10 @@ alias mv="mv -i" # GIT alias gits='git status --short' -alias gp='git push' +#alias gp='git push' alias gl='git pull' -alias ga='git add' -alias gco='git checkout' +#alias ga='git add' +#alias gco='git checkout' alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' # POWER |