Last active
May 19, 2017 15:32
-
-
Save soham2008xyz/96fcf45162f4e933404110f194170722 to your computer and use it in GitHub Desktop.
Shorthand aliases for common Git commands
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
#!/usr/bin/env bash | |
alias gi="git init" | |
alias grao="git remote add origin" | |
alias grso="git remote set-url origin" | |
alias gpom="git push origin master" | |
alias gpum="git push -u origin master" | |
alias gl="git log" | |
alias glo="git log --pretty --oneline" | |
alias gs="git status" | |
alias gp="git push" | |
alias gpl="git pull" | |
alias gf="git fetch" | |
alias gfo="git fetch origin" | |
alias gpf="git push --force" | |
alias gpt="git push --tags" | |
alias ga="git add" | |
alias gaa="git add --all" | |
alias gaaf="git add --all --force" | |
alias gcm="git commit -m" | |
alias gcam="git commit -am" | |
alias gca="git commit --amend" | |
alias gc="git clone" | |
alias gdh="git diff HEAD" | |
alias gr="git reset" | |
alias grh="git reset HEAD" | |
alias grH="git reset HEAD --hard" | |
alias gb="git branch" | |
alias gcb="git checkout -b" | |
alias gco="git checkout" | |
alias gst="git stash" | |
alias gsp="git stash pop" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
Clone this to your home directory into
.gitrc
$ git clone https://gist.github.com/96fcf45162f4e933404110f194170722.git $HOME/.gitrc
Add this line to your
.bashrc
:How to update