Diffrence between (GIT & GITHUB)
GIT
lets first understand diffrence between Git & github
so git is version control system you can say a software which track code
and it can be run internally in your machine, and code changes locally with features like branching and merging.
GITHUB
github is server(remote) its like a database where you can store your data and over the time your code grows so you have need a database, and web-based platform that hosts Git repositories and enables collaboration through pull requests, issues and team management.
Why GIT (vcs) exits?
Lack of a Collaboration System
In early days there was a specific system named (Pendrive system)
what does it mean?
lets understand :-
this wiht a Example , developer A & developer B
Developer A is working on a project and another developer B wants to contribute so he has no way except pendrive system
developer A has to copy the project and save that in pendrive and he has give that to developer B
then developer B implements the feature that he was working on and follows the same steps and gives it back to developer A
And then after sometime he realised he missed something or need to fix a bug and this loop will keep going on going
what was the problem statement lets understand :-
No history
No parallel work
No conflict resolution
Lack of time
And lack collaboration
conclusion : -
we understand the problem statement that & what are the cons , now lets understand how we will fix it through GIT(VCS).
And this is where GIT(vcs) version controll system cames into the picture
version controll system that trackes changes made to files overtime
it allows developers to :-
save and track changes (every modification made to the codebase is recorded )
Revert to previous versions : (if something breaks or a feature doesn't work as expected, you can revert to a stable version)
collaborate : nultiple developers can work on the same project wihtout overwriting each others work.
Branching & Merging: (Developers can create branches for diffrent features , work on them independently , and merge them back to the main directory codebase when ready)
GIT COMMANDS AND WHAT THEY DO
1
Git init
(git init) transform the current directory into git repository.
2
git add
what does git add do ??
(its make sure which files should be inclueded into next commit & and takes it to initial stage , only if you have specif file to be added )
3
Git add . (dot)
in production we dont have a single file , there will be multiple folders and multiple sub folders inlcuding files
so there is where git add . cames into the picture
it add all files in your folder and takes to initial stage.
4
git commit
A commit is like a save point in your project , it takes a snapshot of your files at a certain time , with a message describing what you changed.
5
git push -u origin
git push origin main will push the local main branch to the remote named origin ( on github)
CONCLUSION
Git is an open-source, version control tool created in 2005 by developers working on the Linux operating system ,
Github ia a company founded in 2008 that makes tools which integrate with git
- makes collaboration easy , multiple developers can work on the same project at the same time without any worries or issues
Top comments (0)