Best Way To Use Git Commands
Best Way To Use Git Commands
If you’re one of those developers who still don’t use any version
control system, I don’t know how you’re still managing to get
work done.
In this post, I’m focusing on important git commands that gets all
(almost) your work done ( I know you’re a GUI person ).
1) git config
2) git init
3) git clone
Utility : To copy a git repository from remote source, also sets the
remote to original source so that you can pull again.
How to : git clone <:clone git url:>
4) git status
Utility : To check the status of files you’ve changed in your
working directory, i.e, what all has changed since your last
commit.
How to : git status in your working directory. lists out all the files
that have been changed.
5) git add
6) git commit
8) git branch
9) git checkout
Utility : Switch to different branches
How to : git checkout <:branch:> or **_git checkout -b
<:branch:> if you want to create and switch to a new branch.
Utility : You know when you commit changes that are not
complete, this sets your index to the latest commit that you want
to work on with.
How to : git reset <:mode:> <:COMMIT:>