What is Version Control System or VCM or git
In this tutorial, we are going to learn about Version control system i.e., git in detail where git enables multiple versions of the code bases are kept up to date by setting up a version control system (VCS). Additionally, previous and more recent versions are preserved by VCSs so that we may switch between them whenever we choose and keep track of who is making what modifications.
- This is the process of maintaining multiple versions of the code. All the team members upload their code(check in) into the remote version controlling system. The VCS accepts the code uploads from multiple team members and integrates it so that when the other team members download the code they will be able to see the entire work done by the team.
- VCS’s also preserve older and later versions of the code so that at any time we can switch between which ever version we want VCS’s also keep a track of who is making what kind of changes.
Types of Version Control Systems
- Centralised version controlling: Here we have a remote server(code repository) into which all the team members check in the code and all the features of version controlling are implemented in this remote server.
- Distributed version controlling: Here we have a local repository installed on every team members machines where version controlling happens at the level of individual team members from where it is uploaded into a remote server where version controlling happens for the entire team.
Setting up git i.e., Version Control System on Windows
- Download git from https://git-scm.com/downloads
- Install it
- Open gitbash and execute the git commands
Setting up git in ubuntu linux servers
- Update the apt repository.
sudo apt-get update
- Install git.
sudo apt-get install -y git
- Configuring user and email globally for all users on a system.
git config --global user.name "behind Java" git config --global user.email "[email protected]"
Types of Git work flow or Git stages
On the local machine git uses three sections.
- Working directory: Working directory is the location where all the code is created. Initially all the files present here are called as untracked files.
- Stagging Area: Stagging area is the location where file indexing happens and it is the buffer area of git and the files are called as indexed files.
- Local repository: Local repository is where version controlling happens and the files are called as commited files.