Last active
December 15, 2017 12:08
-
-
Save ravicious/c07a8f7d53881a6f6a20ee60301c2cfc to your computer and use it in GitHub Desktop.
This file contains 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] | |
# Undoes last commit and leaves the files commited by it in the staging area. | |
undo-commit = reset --soft HEAD^ | |
today = !git log --since=midnight --author=\"$(git config user.name)\" --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr)%Creset' --abbrev-commit | |
yesterday = !git log --since="yesterday.midnight" --until=midnight --author=\"$(git config user.name)\" --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr)%Creset' --abbrev-commit | |
# More succint version of `git status`. | |
st = status -sb | |
# It takes ages to type `rebase --continue`. | |
rc = rebase --continue | |
# My preffered version of `git log`. | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
co = checkout | |
com = checkout master | |
# Cool alias if you use autosquashing a lot. | |
ria = rebase -i --autosquash | |
# Needed for the alias in .zshrc. | |
root = rev-parse --show-toplevel | |
# Removes the branch locally and on the `origin` remote. | |
remove-branch = "!f(){ git branch -d ${1}; git push origin --delete ${1}; };f" | |
# For merging branches in repos which use merge commits. | |
mfe = merge --no-ff --no-edit | |
# For merging branches in repos which doesn't use merge commits. | |
mff = merge --ff-only |
This file contains 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
# Jump to the root directory of the current repo. | |
alias gcd='cd $(git root)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment