How to check the status of files?
$ git status
You can display it in a more concised format.
$ git status --short
To know more about Status, click this.
How to check the log?
Before knowing how to log, first, we have to know what log actually means. Log is used to view the history of commits for a repository.
$ git log
OR
$ git log --oneline
To know more about Log, click this.
What is Git Help?
There are hundreds of commands and options in Git. So, it is very hard to remember each one of them. To know more about any command, you can use this to have a better understanding.
To check all available options for any specific command:
$ git <command> -help
To check all possible commands:
$ git help --all
To know more about Help, click this.
What is Git Branching?
Expect to use Git as a version-control system, it is used to collaborate on a project. So, whoever wants to work on a project, they create a new/separate version of the main repository.
Branches help you to work on the project or a part of the project without even impacting the main branch of the project. When the work is completed, you can merge your branch with the main branch.
To have a better understanding of Branch, check out this link.
To make a new branch:
$ git branch <name of the branch>
To check all available branches:
$ git branch
We can switch from one branch to another branch and work on that without impacting the branch we were working on before.
To switch to other branches:
$ git checkout <branch name>
To make a new branch and directly switch to it:
$ git checkout -b <branch name>
To delete a branch:
$ git checkout -d <branch name>
To merge one branch to another branch, first, we need to switch to the branch with which we want to merge. Then we have to run the merge command with the branch name we were working on.
$ git merge <branch name>