1. git clone
This command is used for
downloading the latest version of a
remote project and copying it to the
selected location on the local
E.g : git clone
2. git fetch
This will get all the updates from the remote repository, including new branches.
E.g. git fetch –all [
3. git checkout
You can use this command to switch the branch that you are currently working on.
E.g. git checkout
4. git init
This command is used to start a new empty repository or to reinitialize an existing one in the project root. It will create a .git directory with its subdirectories.
E.g : git init
5. git commit
After changes are done locally, you can save them by “committing” them. A commit is Like local a snapshot of the current state of the branch, to which you can always come back.
E.g. git commit -m “
6. git push
Git push will push the locally committed
changes to the remote branch.
E.g. git push -u origin master
7. git diff
You can use this command to see the
unstaged changes on the current branch.
E.g : git diff –staged
8. git pull
Using git pull will fetch all the changes from
the remote repository and merge any remote changes in the current local branch.
E.g : git pull ‘remote name’ ‘branch name’
9. git add
This is the command you need to use to
stage changed files.
E.g : git add
10. git branch
Using git branch will list all the branches of
the repository. It can also be used to create or delete a branch
E.g. git branch
git branch -d