What is Version Control System ( VCS ) ?
A Version Control System (VCS) is Repository files , every changes made to the files are tracked with Revisions , along with who made change , why they made it and reference to problems fixed or enhancements introduced by the change.
It is also known as Revision Control System (RCS) or Source Code Management (SCM).
It helps the team to ship products faster , improves visibility , Traceability for every change ever made , helps teams collaborate around the World.
Types of Version Control System ( VCS ):
1. Local version Control System
2. Centralized Version Control ol System
3. Distributed Verison Control System
List of VCS tools:
What is GIT?
Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows
Git Workflow - 3 Tier Architecture:
Commands Of GIT
Initializing a repository
Staging files git add file1.js git add . Viewing the status git status - Full status git status -s - Short status Committing the staged files git commit -m “Message” - Commits with a one-line message git commit - Opens the default editor to type a long message Skipping the staging area git commit -am “Message” Removing files git rm file1.js - Removes from working directory and staging area
git rm --cached file1.js. - Removes from staging area only Renaming or moving files git mv file1.js file1.txt Viewing the history git log - Full history git log --oneline - Summary git log --reverse - Lists the commits from the oldest to the newest Viewing a commit git show 921a2ff - Shows the given commit git show HEAD - Shows the last commit git show HEAD~2 - Two steps before the last commit git show HEAD:file.js - Shows the version of file.js stored in the last commi
Checking out a commit
git checkout dad47ed - Checks out the given commit
git checkout master - Checks out the master branch Finding contributors git shortlog Branching & Merging Managing branches git branch bugfix - Creates a new branch called bugfix
git checkout bugfix - Switches to the bugfix branch git switch bugfix -Same as the above
git switch -C bugfix -Creates and switches git branch -d bugfix -Deletes the bugfix branch
Merging git merge bugfix -Merges the bugfix branch into the current branch git merge --no-ff bugfix # Creates a merge commit even if FF is possible git merge --squash bugfix - Performs a squash merge git merge --abort -Aborts the merge Viewing the merged branches git branch --merged - Shows the merged branches git branch --no-merged # Shows the unmerged branches Rebasing git rebase master - Changes the base of the current branch