What Is Version Control And Why You Should Use It

What is Version Control?

Version Control means keeping the copies of your code or files from every stage in its lifecycle. Version control system allows us to manage all versions of our code with representing a single version at a time.

Why use version control?

Sometimes we write code or make changes to the code but later, we realize it was a mistake and want to revert back to the last code, Version Control will do that for you.

If you have to maintain multiple versions of a project or want to see the difference between two (or more) versions of your code or want to review the history of particular code, Version Control maintains it all.

Sometimes we have to submit or merge our code with the development team member's code or want to share our code and let your team member work on that code, you can do that using the version control.

If you want to do an experiment with a new feature or R & D without interfering with the working code, version control gives us the flexibility.

This will give great confidence to the development team to do experiments with the code as we can rollback at any time to last code.

With the automated feature, Version Control helps to automate testing, code analysis, and deployment when new versions are saved to version control. This will save the development team's time.

Two types of version control are supported by Visual Studio Team System, Git, and TFVC. Now as a developer we always have a question, which version control system should I use?

What is Git? (Distributed)

Git is a version control system, its open source and Distributed, designed to manage project speedy and efficient.

(Image Source: https://code.snipcademy.com/tutorials/git/introduction/how-version-control-works)

In the Distributed framework, all developers have their local copies of files on the local repository, and when they push or comment the changes are stored at local repo first. In the below screen, you can see that the commit was first created locally, and then after checking you can Sync changes to the server.

There is no central repository to depend upon, you have a full history of the repository locally.

Developers push their changes continuously and integrators can review and bring changes to the reference code asynchronously.
integrators take successfully build code from the local repository and publish on server repository.

What is TFVC? (Centralized)

Team Foundation Version Control is a Centralized version control system, here team member has only one file on the machine and Historical data is maintained on the main server. 

(Image Source: https://code.snipcademy.com/tutorials/git/introduction/how-version-control-works)

Team member checks-in their code in TFS and we can audit user wide changes in a change-set, and using compare we can identify the exact changes that they have made.

Here in Centralized System developers commit their changes directly to the main server repository.

That means a single point of failure or unsolicited change can destroy all builds. Remote commits are very slow in Centralized System.
Git is open source and cross-platform so support is available for all platforms, multiple sets of technologies, languages, and frameworks in the same solutions. The main benefit of Git is it is supported by virtually all operating systems.

Git has an Automatic backup of the whole repository, everytime someone pulls from the central repo, the developer gets a full history of the changes. When one repo gets lost take one of those present on every workstation.

Due to offline repo access, developers can work from anywhere, we can see the full history of the project, every single check-in, without starting up VPN connection. Branching and merging algorithms are much more efficient in Git.

Working and committing changes to your branch locally and reviewing your changes becomes much easier.

The mechanism of pulling requests is very cool.  Even Visual Studio Online Default repository is Git repository. Generally, a team is familiar with TFS so it's easy to start UI tool IN Visual Studio makes it easy. For people who are new to Git there is a small learning curve, and  they can just practice here.

In TFS Check is slow in comparison to Git; also you need to make sure the central server is backed up. Merge conflicts are frequent and we have to resolve that manually. Branching frequently is a very time-consuming process in TFS and the main issue with TFS is TFS Requires Visual Studio.

There are lots of things that can take up your time as a development team, such as reproducing bugs, R & D new tools, and adding new features. As the demands of your users increase, version control helps your team to work in a collaborative way and deliver on time.

I hope you liked this article. Please let me know your feedback in the comment section. In the next article, I will try to explain how to add a project in TFS and Git practically.

  • https://blog.kloud.com.au/2016/03/08/why-you-should-use-git-over-tfs/
  • https://www.tshooter.com.br/en/2016/03/07/eight-reasons-to-prefer-git-to-invs-tfvc/
  • https://docs.microsoft.com/en-gb/vsts/tfvc/comparison-git-tfvc
  • https://docs.microsoft.com/en-gb/vsts/tfvc/overview