Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. [alias]
  2. # branch (verbose)
  3. br = branch -v
  4.  
  5. # commit
  6. ci = commit
  7.  
  8. # amend your last commit
  9. amend = commit --amend
  10.  
  11. # amend your last commit
  12. ammend = commit --amend
  13.  
  14. # cleanup local branches after they have been merged
  15. cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"
  16.  
  17. # checkout
  18. co = checkout
  19.  
  20. # checkout pr #<nr>
  21. co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
  22.  
  23. # fixup
  24. fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
  25.  
  26. # fetch origin
  27. fo = !git fetch origin
  28.  
  29. # fetch upstream
  30. fu = !git fetch upstream
  31.  
  32. # fetch origin and rebase with origin/master
  33. fro = !git fetch origin && git rebase origin/master
  34.  
  35. # fetch upstream and rebase with upstream/master
  36. fru = !git fetch upstream && git rebase upstream/master
  37.  
  38. # pretty log
  39. lg = log --graph --pretty='format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
  40. lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
  41. promote = !$DOTFILES/bin/git/git-promote
  42.  
  43. # rebase
  44. rb = rebase
  45. ri = rebase --interactive --autosquash
  46.  
  47. # commit with squash tag
  48. squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
  49.  
  50. # status
  51. st = status
  52.  
  53. # working in progress commit
  54. unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
  55. wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\" --no-verify"
  56.  
  57. # via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
  58. snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
  59. snapshots = !git stash list --grep snapshot
  60. ours = "!f() { git checkout --ours $@ && git add $@; }; f"
  61. theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
  62.  
  63. # via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
  64. recent-branches = !git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='%(refname:short)'
  65.  
  66. [apply]
  67. whitespace = fix
  68.  
  69. [branch]
  70. autosetuprebase = always
  71.  
  72. [branch "master"]
  73. remote = origin
  74. merge = refs/heads/master
  75.  
  76. [pull]
  77. rebase = preserve
  78.  
  79. [color]
  80. diff = auto
  81. interactive = auto
  82. status = auto
  83. ui = auto
  84.  
  85. [commit]
  86. template = ~/.gitmessage
  87.  
  88. [core]
  89. attributesfile = ~/.gitattributes
  90. autocrlf = input
  91. editor = vim
  92. excludesfile = ~/.gitignore
  93. quotepath = false
  94. safecrlf = true
  95. whitespace = cr-at-eol,space-before-tab,-indent-with-non-tab,trailing-space
  96.  
  97. [color "branch"]
  98. current = yellow reverse
  99. local = yellow
  100. remote = green
  101.  
  102. [color "diff"]
  103. meta = yellow bold
  104. frag = magenta bold # line info
  105. old = red # deletions
  106. new = green # additions
  107.  
  108. [color "status"]
  109. added = green
  110. changed = yellow
  111. untracked = cyan
  112.  
  113. [diff]
  114. renames = copies
  115. tool = vimdiff
  116. # Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
  117. # instead of a/b/c/d as prefixes for patches
  118. mnemonicprefix = true
  119. algorithm = patience
  120.  
  121. [difftool]
  122. prompt = false
  123.  
  124. [fetch]
  125. prune = true
  126.  
  127. [format]
  128. pretty = %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset
  129.  
  130. [hub]
  131. protocol = https
  132.  
  133. [mergetool]
  134. keepBackup = false
  135.  
  136. [rebase]
  137. autosquash = true
  138. autostash = true
  139. stat = true
  140.  
  141. [rerere]
  142. enabled = 1
  143. autoupdate = true
  144.  
  145. [status]
  146. showUntrackedFiles = all
  147.  
  148. [push]
  149. default = simple
  150.  
  151. [tag]
  152. sort = version:refname
  153.  
  154. [include]
  155. path = .gitconfig.local
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement