Skip to content

Instantly share code, notes, and snippets.

@ecarlisle ecarlisle/git-aliases.sh
Last active Feb 10, 2019

Embed
What would you like to do?
Git aliases for a shell configuration.
# ---------- ADD ---------- #
alias ga = git add # Add new or changed files to the index.
alias gap = git add -p # Add new or changed files to the index by hunk.
# ---------- BRANCHES ---------- #
alias gb = git branch # View repository branches.
alias gbr = git branch -r # View remote branches.
alias gba = bit branch -a # View both local and remote branches.
# ---------- CHECKOUT ---------- #
alias gco = git checkout # Checkout files.
alias gcob = git checkout -b # Checkout a new branch
# ---------- COMMIT ---------- #
alias gc = git commit # Commit changes.
alias gcm = git commit -m # Commit changes with message
# ---------- PUSH, PULL, FETCH ---------- #
alias gpull = git pull # Pull newer commits to branch.
alias gpush = git push # Push newer commits to branch.
alias gfetch = git fetch # Get repository branches, tags.
alias gmerge = git merge # Merge branches.
# ---------- STASH ---------- #
alias gstash = git stash # Stash branch changes.
alias gstashp = git stash pop # Place stashed state onto current tree state.
alias gstashl = git stash list # View list of all branch stashes.
# ---------- STATUS ---------- #
alias gs = git status # View current branch status.
alias gl = git log # View commit log.
# ---------- CLONE ---------- #
alias gcl = git clone # Clone a repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.