Branch Out With Git

If you’re a developer then it’s quite likely you already know what Git is. If not then it can be quite confusing when you stumble into a conversation about branches within repositories. The usual ‘simple’ explanation is that it’s a version control system which lets you track changes to code during development. Which is all well and good, but it doesn’t really explain anything about the methodology. Here’s the answer to a couple of basic questions:

 

What’s the difference between a repository and a branch?

Repository: The whole project – the container within which all the work and history is contained

Branch: A specific version of your code (hence the version control) – a repository can contain multiple

 

Why do you branch?

Good question – the main reason is that it allows multiple teams to work on different parts of the project at once. During development, it’s inevitable that you’ll run into bugs and other issues. If multiple teams are all working on the same code at once then the team will struggle to execute multiple aspects of the project without introducing inadvertent conflicts, slowing down one another’s work. By using a version control system development speed is generally increased and

Want to learn more? Let's talk: