SHARE
TWEET

Untitled

a guest Oct 9th, 2019 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # Include this in your own .gitconfig by using the
  3. # [include] directive with the path to this file
  4. #
  5. # [include]
  6. #    path = ~/.gitconfig.aliases
  7. #
  8. # If you don't have any existing includes, you can add this via the following command
  9. #
  10. #   git config --global include.path ~/.gitconfig.aliases
  11. #
  12.  
  13. [alias]
  14.     abort = rebase --abort
  15.     aliases = "!git config -l | grep alias | cut -c 7-"
  16.     amend = commit -a --amend
  17.     # Deletes all branches merged into specified branch (or master if no branch is specified)
  18.     bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -I % git branch -d %; }; f"
  19.     # Switches to specified branch (or master if no branch is specified), runs git up, then runs bclean.
  20.     bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
  21.     # Lists all branches including remote branches
  22.     branches = branch -a
  23.     browse = !git open
  24.     # Lists the files with the most churn
  25.     churn = !git --no-pager log --name-only --oneline | grep -v ' ' | sort | uniq -c | sort -nr | head
  26.     cleanup = clean -xdf -e *.DotSettings* -e s3_keys.ps1
  27.     # Stages every file then creates a commit with specified message
  28.     cm = !git add -A && git commit -m
  29.     co = checkout
  30.     cob = checkout -b
  31.     # Show list of files in a conflict state.
  32.     conflicts = !git diff --name-only --diff-filter=U
  33.     cp = cherry-pick
  34.     db = !GIT_TRACE=1 git
  35.     delete = branch -d
  36.     # Discard changes to a file
  37.     discard = checkout --
  38.     ec = config --global -e
  39.     find = "!git ls-files | grep -i"
  40.     graph = log --graph -10 --branches --remotes --tags  --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order
  41.     grep = grep -Ii
  42.     hist = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
  43.     history = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
  44.     # Shows the commit message and files changed from the latest commit
  45.     latest = "!git ll -1"
  46.     lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
  47.     lost = fsck --lost-found
  48.     # A better git log.
  49.     ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
  50.     # Moves a set of commits from the current branch to another
  51.     migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-$CURRENT@{u}} && git rebase --onto ${2-master} $CURRENT; }; f"
  52.     open = "!f(){ URL=$(git config remote.origin.url); open ${URL%.git}; }; f"
  53.     pr = "!f(){ URL=$(git config remote.origin.url); open ${URL%.git}/compare/$(git rev-parse --abbrev-ref HEAD); }; f"
  54.     parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
  55.     publish = "!f() { git push origin $1 && git push drafts :$1 && git browse }; f"
  56.     rba = rebase --abort
  57.     rbc = "!f(){ git add -A && git rebase --continue; }; f"
  58.     re = "!f(){ git fetch origin && git rebase origin/${1-master}; }; f"
  59.     remotes = remote -v
  60.     restore = "!f(){ git add -A && git commit -qm 'RESTORE SAVEPOINT'; git reset $1 --hard; }; f"
  61.     ri = "!f(){ git fetch origin && git rebase --interactive origin/${1-master}; }; f"
  62.     save = !git add -A && git commit -m 'SAVEPOINT'
  63.     set-origin = remote set-url origin
  64.     set-upstream = remote set-url upstream
  65.     st = status -s
  66.     stashes = stash list
  67.     sync = !git pull --rebase && git push
  68.     undo = reset HEAD~1 --mixed
  69.     # Unstage a file
  70.     unstage = reset -q HEAD --
  71.     up = !git pull --rebase --prune $@ && git submodule update --init --recursive
  72.     wip = commit -am "WIP"
  73.     wipe = "!f() { rev=$(git rev-parse ${1-HEAD}); git add -A && git commit --allow-empty -qm 'WIPE SAVEPOINT' && git reset $rev --hard; }; f"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top