How to define Git commands Aliases

Method 1:

$ git config --global checkout
$ git config --global branch
$ git config --global commit
$ git config --global status
$ git config --global 'commit -v'
c:\dev> git config --global "commit -v"

Method 2:

st = status
ci = commit -v
st = status
ci = commit
co = checkout
br = branch
unstage = reset HEAD --
last = log -1 HEAD
$ git config --global alias.unstage 'reset HEAD --'
$ git unstage fileA
$ git reset HEAD -- fileA
$ git config --global alias.last 'log -1 HEAD'
$ git last
commit 66938dae3329c7aebe598c2246a8e6af90d04646
Date: Tue Aug 26 19:48:51 2008 +0800
$ git config --global alias.visual '!gitk'




Posting about Python and Laravel

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Making mistakes with GraphQL

I Thought I Wasn’t the “Programmer Type”

Service Mesh — Istio

From Solo to Pair programming

Meddle into Mettle Web Components

Prison Cells After N Days

Overcoming Mobile Development Challenges for Consumer Apps

My Experience at Devcreer x Progate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Posting about Python and Laravel

More from Medium

ngrok — Make full use of free tier version to expose your localhost to the internet

Docker Ep 16: Named Volumes

Git Undo Scenarios

How to Reset a Root Password in CentOS-based Linux Systems