Many of you especially beginners are confused about Git.
On Google there are millions of answers that explains about the concept of Git.
The technical definition about Git says that
Git is a Version Control System (VCS) for tracking source code during Software Development.
A Version Control System in simple words can be regarded as a Source Code Management(SCM), which typically manages your different version of your information(i.e your source code).
It keeps track of your modifications done to your code and record the changes you made to it.
Local Version Control System - It has a database system that manages the track.
Centralized Version Control System - Where all the users connect to a master(central) repository.
Distributed Version Control System - Where all the users can connect to multiple repositories at a time.
In simple words, repo/repository is a type of container where we store something. Technically it is a data structure which is used by VCS where metadata of our code files and directories are stored.
Commit is a simple collection of message that explains more about the source code files and how we came to that stage. It can reminds you your intention behind changing those files, It can also help the user that uses your repo.
Think this as a simple tree branch which diverges from the main root, similarly git branch is the version of repo that divide from the main repository. In branch repo we can make various changes like:list, delete, rename etc.
Cloning in git means making a copy of the target repo and duplicating all the files of the target repo. Clone is the git command line utility.
Index in git is also know as Staging area/Staging Index. A file in the Git directory that stores information about what will go into your next commit. Files on the Staging Index are poised to be added to the repository.
Push and Pull request:
Git push will take all your files from the local repo and will push it to the main repo for example on Github.
Git pull is used when you want to pull the latest changes in your main repo.
git init- To initialize or create a repository.
git add.- To add your code files to your repo.
git status- To view your files in the repository.
git commit -m 'your message'- To add commit messages to your code files.
git push -u origin master- To push the code in your main repository or target repository.
git pull 'remote_name' 'branch_name'- It will pull the contents from the main repository.
git fetch- It will fetch the recent commits from the main repo to your local repository.
git merge- It will merge the branch from remote to local repository.
git clone repoLink- To clone the target repository.
So That's it for Git, I hope this article will help you with your learning and will be your easy to read guide. Let me know if this article helps you.
Go on and create your first project on Github with the help of this article.🙂
Hope you enjoyed reading. ❤️