Skip to content

Instantly share code, notes, and snippets.

@garbray
Created July 14, 2020 13:57
Show Gist options
  • Save garbray/79f69c6cfe113511462f4122b282ae36 to your computer and use it in GitHub Desktop.
Save garbray/79f69c6cfe113511462f4122b282ae36 to your computer and use it in GitHub Desktop.
git aliases
# git alias
alias gp="git pull"
alias gps="git push"
alias gpd="git pull develop"
alias gck="git checkout"
alias gr="git rebase"
alias grm="git rebase master"
alias gd="git diff"
alias gc="git commit"
alias gli="git log --oneline"
alias gca="git commit --amend"
alias glg="git log --oneline --graph"
#alias gsoft="git reset --soft $(git merge-base origin/master Head)"
alias grh="git reset head --hard"
alias grs="git reset head --soft"
function gsoft() {
git reset --soft $(git merge-base origin/master Head)
echo "$FGRN stash branch changes"
git stash
echo "$FGRN checkout master"
git checkout master
echo "$FGRN pull master"
git pull
echo "pull master"
if [ -z $1 ]; then
echo "$FRED you need to process rebase manually"
else
echo "$FYEL changing to branch $1"
git checkout $1
git rebase master
git stash pop
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment