What is Git and Why Use It?
Basically, Git is a commonly used version control system (VCS) that helps developers keep track of changes they made so that there are records of what has been done. You can also revert or go back (undo) to any specific versions if needed.
Git helps make collaboration between developers easier by allowing multiple changes to be merged into one source.
Git runs locally which means your files and their history are stored on your pc.
VCS Generation
1st Generation
- The first generation VCS were intended to track changes for individual files and checked-out files could only be edited locally by one user at a time.
- Weakness: Code can be edited by one user at a time.
- SCCS (Source Code Control System), RCS (Revision Control System).
2nd Generation
- Allowed multiple users to check out and work with the code at the same time, but they would all be committing back to the same central repository.
- Weakness: network access was required to make commits.
- Example: CVS (Concurrent Versions System), SVN (Apache Subversion).
3rd Generation
- The third generation comprises the distributed VCS.
- Example: Git, Mercurial, Bazaar.
- The difference is, that it has a server repository (in pc).
- SCM > VCS > Git > Github, Gitlab (git provider).
Git Workflow
Terms When Using Git
1. Clone
- Like a 'pull', where we take the source code from 'Remote' into our PC. (first code).
2. Commit
- Choose which file to be committed.
- When we choose to commit, it will save the changes to the local repository. Then, will push to the remote repository. (here is where our base code lies. So, need to be careful).
- "Commit changes".
3. Push
4. Pull
- Take the changes and insert them into the local repository.
5. Merge
No comments:
Post a Comment
Komen atau sebarang pertanyaan di sini :)