-
-
Save jpalala/b8298ea4050694840f26 to your computer and use it in GitHub Desktop.
git aliases in my gitconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| co = checkout | |
| cob = checkout -b | |
| st = status | |
| s = status | |
| ci = commit | |
| c = commit | |
| br = branch | |
| a = add | |
| d = diff | |
| mum = merge upstream/master | |
| fu = fetch upstream | |
| mm = merge master | |
| hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
| type = cat-file -t | |
| dump = cat-file -p | |
| del = rm | |
| last = log -1 HEAD | |
| # Unstage any files that have been added to the staging area | |
| unstage = reset HEAD | |
| # Show changes that have been staged | |
| diffc = diff --cached | |
| # Mark a file as "assume unchanged", which means that Git will treat it | |
| # as though there are no changes to it even if there are. Useful for | |
| # temporary changes to tracked files | |
| assume = update-index --assume-unchanged | |
| # Reverse the above | |
| unassume = update-index --no-assume-unchanged | |
| # Show the files that are currently assume-unchanged | |
| assumed = "!git ls-files -v | grep ^h | cut -c 3-" | |
| # Delete any branches that have been merged into master | |
| # See also: https://gist.github.com/robmiller/5133264 | |
| delete-merged-branches = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" | |
| # Checkout our version of a file and add it | |
| ours = "!f() { git checkout --ours $@ && git add $@; }; f" | |
| # Checkout their version of a file and add it | |
| theirs = "!f() { git checkout --theirs $@ && git add $@; }; f" | |
| # Search/grep your entire codebase for a string: | |
| grep = grep -Ii | |
| gr = grep -Ii |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment