Mytutorialrack

We as web developers, we work on all types of project from small to medium to complex projects.
Click on Git Complete Hands on Training for Web developers
When we are the only one working on a website, we code everything at once and then upload it, but when you have team of developers working on a large project,and each one is working on a component of the project, then everyone can’t just upload there changes blindly, at that time
a version control system comes to rescue. I am working on an online course on Git Version Control , which will be live in next couple of days. If you want an early bird discount on the course please register below.
Version control system as the name indicates it keeps track of the versions of your project.There are a lot of version control system software present out there.Today in this blog post, I will be covering a very powerful version control software named
Today in this blog post, I will be covering a very powerful version control software named Git. With the help of Git, multiple developers can work on the same project at the same time, without interfering in each other task.
 

Why you need version control software?

As the name says it all” version” , it keeps track of versions of your project. Who changed what, and when ? but it is way  more than just keeping track of who changed what.With the help of Git, you can easily track what changes were made to your code, allows you to backtrack if necessary and also undo these changes.
Git ability of tracking the  changes and  reverting the changes, makes it very invaluable when we are working on large projects and we have a team of developers working towards the goal.
It doesn’t matter you are a Java developer or a .Net developer or a Salesforce developer you need a version control software. You probably have done this yourself, saving multiple copies of a file to have a backup.
In a version control software, it tracks and saves only the changes instead of the whole file- a patch file that can be applied to older version to update it to newer or next version.
This is fine when you have one developer working on the project but in team of multiple developers you need more than that. That’s when the idea of centralized version control system comes in. In centralized version control, you have a central repository where you store all your project files and individual developers checkout and upload there changes to the Central repository.
 

Version control software can be of two types:

  • Centralized Workflow
  • Distributed Workflow

In centralized version control, you have a central repository where you store all your project files and individual developers checkout and upload their code changes to this central repository.
centralizedworkflow
The benefit of using a central repository is that multiple developers can make changes and each change can be associated with a specific developer. So you know who made what change.
 
 
 
 
The disadvantages of using this centralized version control software are:

  • Since this central repository might be on your company’s network and if the network is down no one will be able to make changes.
  • The other disadvantage of using a centralized repository is that its a single point of failure. So if this repository crashes,there is no way to recover our changes.
  • The last disadvantage of using central repository is since this repository is remote, you are making your changes over the network which might be slow.

 
So this takes to another type version control system called as distributed version control system. In these systems,every developer in the team has full repository on his local file system. So it’s easier to recover the loss in case of failure.
distibutedworkflow

Benefits of working with Git:

As you all know by version control software keeps track of all the code changes you do in your project. Every time, someone in your team make the change to the files in the project, he/she can push those changes to the repository. And everyone else in the team can pull those changes from the repository and then you can continue with the development.
Working offline:
Version control software like CVS and Subversion used a remote repository which is accessible over the network and where all your code changes lie.
This might result into over load on the network because you are directly interacting with the central repository but in case of Git you also have the option of local repository where you have a complete copy of the “repository”.
You can commit the changes you do directly to the local repository. So with Git you have the option of working offline.Once you are finished with your changes and have verified it then you can push these changes to the remote repository in one shot.
Git is faster:
Since most of the operations are performed directly on the local filesystem, they are faster as compared when you do it online over the network.
Repositories are small:
Packaging of the project with Git is different and smaller as compared to the repository created under subversion. A Git repository is smaller as compared to using Subversion. You can read more about this here.
Moving or Adding files:
In the older version control applications like CVS, moving a file would require you to create a new file in the repository and remove the older one from the repository which resulted in wiping off the history,but in case of Git,it automatically track the moves.
And another important feature with Git is when you have to add multiple files with same extension, you can use wildcard instead of listing down all file names.For e.g.
git add index.html one.html green.html
You can directly say,
git add ‘*.html’
Ignore Certain Files:
Sometimes files also get generated by the project or by the IDE you are using for eg: log files. These files have nothing to do with your project and you do not want to save those files in your repository because they are not part of your project.
In these types of cases, you can tell git to ignore such files by using the extension .gitignore. This way Git will ignore such files and will exclude them from the entire version control process.
 
 

Share:

Recent Posts