tadghh / git-aliases

Git aliases simplifying common or odd tasks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Aliases

Git aliases simplifying common or odd tasks.

How to add an alias

  • Edit your .gitconfig file
    • C:\Users\%USERNAME%\.gitconfig
    • Under the [alias] section
  • git alias command
    • git config --global alias."alias name" "command1; command2; command3"
    • Ex.
      • git config --global alias.atomic '!f() { git add . && git commit -am "$1" && git push; }; f'

Aliases

Atomic commits

add untracked files, commit, and push.

Usage
git atomic "Title" "Message"
Install Command
git config --global alias.atomic '!f() { git add . && git commit -am "$1" && git push; }; f'

Refresh local

Clears all local changes and pulls the latest version of the current branch.

Usage
git fresh
Install Command
git config --global alias.fresh '!f() { current_branch=$(git rev-parse --abbrev-ref HEAD); git reset --hard; git fetch origin; git checkout $current_branch; git pull origin $current_branch; }; f'

About

Git aliases simplifying common or odd tasks.