You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git is version-control software that helps the software developers to collaborate with each other.
Version control system helps to maintain history of changes that are made into the software.
Required terminology
Repository:
It is container or we can say big box where contains all the files and folder and it is used by the git to keep track.
The repository stores number of projects and each project is shared among the team.Thus the access privilege is given to each authorized team member.
Commit:
Commit is nothing but the saving your work.when you enter the commit command to repository then it take the pictures/snapshots of the files which are present at the time.
Result of the commit command only affects on local repository.
The function of version control is managed by the commit,where it stores the previous all version of the software
Push & Pull:
Push is to make actual changes into remote repository by syncing from local repository.
Pull command is used to download and integrate remote changes.
Branch:
Assume the git repository as a tree,so that the main software is called as master branch and all remain branches of that tree is called as branches.
Branches are separate instance of the code that is different from master branch/main codebase.
It helps to dividing the work into number of branches by giving seprate copy of codebase.Once all work is done and error free it will merge it back to master branch
Merge:
It is kind of integration related to two branches where it helps to merge the branch with the master branch when branch is free of bugs.
Clone:
Cloning is taking copy of entire online repository into the local machine.
Fork:
Fork is similar to Clone except it takes entirely new repo of that code under your own name.
A forked repository differs from a clone in that a connection exists between your fork and the original repository itself.
In this way, your fork acts as a bridge between the original repository and your personal copy where you can contribute back to the original project using Pull Requests.
Git Internals
States related to file:
1. Modified:
file is changed but not committed to local repository.
this is genral modification of file content through notepad and any file editor.
2. Staged:
Before commit, You have to fire the git add command and tranfer file state from modified to staged.
Once command is fired, Check status by using git status command.
Marking the modified files in current version to go into next picture/snapshot is staging.
3. Commited:
data is safely stored and changed in local repo in form of pictures/snapshots.
To commit the file you have to fire the git commit command.
There are 3/4 different tress are maintained at one time of instance for your software code/repository.
Workspace, Staging, Local Repository, Remoter Repository