This document is a brief introduction to the version control system. The main purpose of this topic is to elaborate on version controlling in software system development.
In General aspects, There are two kinds of version control one is centralized and another one is distributed.
Distributed version control is more modern, runs faster and has more features.
In centralized version control, each user gets a working copy, but there is just one central repository. One user can commit and update their changes at once. As soon as you commit, then only it will be available for others to update and to view your updates.
Every change made to the files by any of the users is tracked, along with who made the change, why they made it.
Benefits of Version Control System:
It is the solution to the long-term changes history of maintaining the file backup versioning. Every change made by the individuals if working in parallel in the team for the same project, you do not need to worry about the backup or merging their work.
Branching and merging make the benefit to a team member that provides the ability to work on an independent stream without having the affection of others, making changes in the same file. It provides the facility to merge that work back together, enabling developers to verify that the changes on each branch do not conflict.
Top Version Control Systems Git is free of cost and open source distributed version control (DVC) system for software programming advancement.
- GIT
- CVS
- SVN
- Assemble
- Mercurial
GIT
Git is a costless and open-source Distributed Version Control (DVC) system for software improvement. Git is a version control system that allows the user to manage their repositories in the product life cycle.
Git is particularly adept at organizing, branching, and dissemination of code. Git is a Version Control System (VCS) and that to be distributed system which was developed by Linus Torvalds
GIT Commands:
Command: git config
Usage: git config –global user.name “[name]”
Usage: git config –global user.email “[email address]”
This is used to tell the user name and email address just to get details before committing the change, will show as your details.
Command: git init
Usage: git init (repository name)
This is used to start a new repository.
Command: git clone
Usage: git clone (repository URL)
This is used to get cloned (copy) a repository from an existing URL.
Command: git add
Usage: git add (Target file)
This will add a file to the staging area.
Usage: git add *
This will add one or more to the staging area.
Command: git commit
Usage: git commit -m (commit message)
This will update the file permanently in the version history.
Usage: git commit -a
This will commits any files you’ve added in the git repository add command and also commits any files you’ve changed.
Command: git diff
Usage: git diff
This command will show the file differences which are not yet staged.
Usage: git diff –staged
This command will show the differences between the files in the staging and the latest version available.
Usage: git diff (first branch) (second branch)
This will show the differences between the two branches mentioned.
Command: git status
Usage: git status
This command will list all the files that have to be committed.
Command: git rm
Usage: git rm [file]
This command will delete the file from your working directory and stages the deletion.
Command: git branch
Usage: git branch
This command will list all the local branches in the current repository.
Usage: git branch [branch name]
This command creates a new branch.
Usage: git branch -d [branch name]
This command deletes the feature branch.
Command: git checkout
Usage: git checkout (branch name)
This will switch you from one branch to another.
Usage: git checkout -b (branch name)
This command will create a new branch and also switches to it.
Command: git merge
Usage: git merge (branch name)
This will merge the specified branch’s history into the current branch.
Command: git remote
Usage: git remote add (variable name) (Remote Server Link)
This command is utilized to interface your local vault to the remote server.
Command: git push
Usage: git push (variable name) master
This command will send the submitted changes of the expert branch to your remote archive.
Usage: git push (variable name) (branch)
This command will send the branch commits to your remote repository.
Usage: git push –all (variable name)
This will push all branches to your remote repository.
Usage: git push (variable name) : (branch name
This will deletes a branch on your remote repository
Command: git pull
Usage: git pull (Repository URL)
This command will fetch and merges changes on the remote server to your working directory.
Command: git stash
Usage: git stash save
This command will temporarily store all the modified tracked files.
Usage: git stash pop
This will restore the most recently stashed files.
Usage: git stash drop
This will discard the most recently stashed changes.
Conclusion:
A version control system or VCS is a source of technics that tracks and manages changes to files by using a single repository within the team. A VCS also offers collective and collaborative utilities to share and integrate the file changes to other users.
Version control software monitors each alteration modification to the. If any pointless changes are made, a user can see back the history logs and analyze prior versions of the file with assistance to fix the mistake while limiting disturbance to all team members.