About Git
Git is a Source Code Management Tool.
It is a free and open-source version control system.
Git helps to keep track of different versions of a single code base by tracking all changes.
Git is Distributed Version Control System(DVCS).
Stages in git
- Workspace/Working directory
- Staging area
- Local Repository
Workspace:- it is your working directory
Staging Area:-
Local repo:-
Git Commit
It stores changes in repository
It uses SHA-1 checksum concept
If you change anything in code then commit id will be changed
You can easily track changes through commit id
Tags in git
Tag assigns a meaningful name with a specific version in repository, like we let some change in code and assign tag with commit id to identify its easily.
Git Push
When we done with our code and went to add the code in remote repository, then we will use the push command to transfer the code from local repository to remote repository.
Git Pull
Pull command copy the code from remote repository to local repository
Branch in Git
Branch is a place where your code is placed, it may be master or main branch.
Each task has one separate branch.
Branch Merge
Branch merge means if someone working some other code and you went to add their code in your branch/code then merge command will be use.
Git Conflict
When same file having different content in different branches, git conflict occurs when you merge them in single branch.
Git Stashing
Git stashing is a temporary storage for your code, it mean if your are working on new project and someone told you to work on old project, in this case you can store your new project in stashing area for few hours.
Git Reset
It is powerful command that is used to reset local changes to the state of git repository. We will use this command when we want to discard the changes, it will revert the commit id to previous commit id.
Git Revert
The revert command helps you to create new commit and it will create new commit which is opposite to existing commit without deleting data.