Git is a free and open-source distributed version control system designed to handle projects with speed and efficiency.
Real-life projects generally have multiple developers working in parallel and the code in Git keeps changing as more code is added by developers. Git helps us with the following features:
- Maintain history of what changes have happened
- Revert or go back to previous versions
-
A repository is similar to how you store files in a folder or directory on your computer. In git, files are stored in a repository. A remote repository refers to the files in GitHub and a local copy refers to the files on your computer.
-
In Git, a branch can be considered as an independent line of development to isolate our work from others.
-
Fork is nothing but a copy of a project present in git. When we want to contribute to someone else’s project, we first make a copy of it in our own namespace.
-
Cloning/downloading is the process of creating a copy of a remote repository’s files on our computer.
The only difference between download and clone is that, if we download a repository we cannot sync the repository with the remote repository on git.
But if we clone, it preserves the git connection ,and we can upload the changes made locally to the remote repository.
-
After changes are made to the local copy of a repository we can upload the changes to the remote repository using the push feature.
-
When the remote repository changes, our local copy is left behind. We can update our local copy with the new changes in the remote repository using the pull feature.