Shortcuts to common commands

One thing you may find useful is to shorten common commands such as git checkout and so on; therefore, useful aliases can include the following:

[1] ~/grocery (master) 
$ git config --global alias.co checkout 
 
[2] ~/grocery (master) 
$ git config --global alias.br branch 
 
[3] ~/grocery (master) 
$ git config --global alias.ci commit 
 
[4] ~/grocery (master) 
$ git config --global alias.st status 

Another common practice is to shorten a command, adding one or more options you use all the time; for example, set a git cm <commit message> command shortcut to the alias git commit -m <commit message>:

[5] ~/grocery (master) 
$ git config --global alias.cm "commit -m" 
 
[6] ~/grocery (master) 
$ git cm "My commit message" 
On branch master 
nothing to commit, working tree clean 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.183.89