Skip to content

Instantly share code, notes, and snippets.

@ecarlisle
Last active February 10, 2019 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecarlisle/85aa67c3d98ec554a31b48543abad4e6 to your computer and use it in GitHub Desktop.
Save ecarlisle/85aa67c3d98ec554a31b48543abad4e6 to your computer and use it in GitHub Desktop.
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