2017年1月23日星期一

Git Command- A simple Way


Intro
As a beginner of using Git, I want to keep it simple and don't want to study deeply into it.
2 days of study and research on Git is enough for me.
Most Useful Command
I find that, below command is the most useful and can help me to do the version control perfectly in most of the time.
image
That's it. No more complex things is needed.
 
However, the next question is, if I every time type all those command again and again, it is quite annoying…Disappointed smile
Can we do better?
Sure we can!!Winking smile
Shortcut of Git Command
In bash shell, there are something called "alias" which can define our own short cut.
As I am using SourceTree for Git client and it is embedded Git, so I can't directly add alias on Git bash shell.
However, there are another way to define it through bash.bashrc .
For SourceTree, it is on C:\User\xxxx\AppData\Local\Atlassian\SourceTree\git_local\etc
Then , just add below code. For the details, please go the link on reference.
image
 
That is very powerful ,effective and easy to remember!Light bulb
You can set anything you want.
Perfect!!Star
Test some command
gs
image
greset
image
All Works like a charm!!Thumbs up
Conclusion
From now on, I just need to memorize gaa, gcm,gb,gclean,greset,gco
That's really makes things more simple!!
Good.
Reference:
Good reference for command shortcut
[1] https://jonsuh.com/blog/git-command-line-shortcuts/


沒有留言:

發佈留言