Git Aliases Simple aliases

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

There are two ways of creating aliases in Git:

  • with the ~/.gitconfig file:
[alias]
    ci = commit
    st = status
    co = checkout
  • with the command line:
 git config --global alias.ci "commit"
 git config --global alias.st "status"
 git config --global alias.co "checkout"

After the alias is created - type:

  • git ci instead of git commit,
  • git st instead of git status,
  • git co instead of git checkout.

As with regular git commands, aliases can be used beside arguments. For example:

 git ci -m "Commit message..."
 git co -b feature-42


Got any Git Question?