Have you ever experienced something like this the following scenario?
You create an important document.
Because it’s important you email it to some friends or family or colleagues for feedback on it.
You re-read it yourself, and then create a new edited version.
Then you get back feedback from someone you sent it to, but the feedback is on your original version.
You then have to merge the two versions by hand.
After doing a lot of merging of documents by hand, you might have a folder that looks like the following:
mydoc.odt
mydoc2.odt
mydoc-moms-edits.odt
mydoc2-plus-moms-combined.odt
Or maybe you have experienced this on a larger scale... For example, three of your friends comment on different versions, and then they each share their edits with the whole group via email. Some comment on the original version, some comment on your mom’s version, others comment on your brother’s version, etc.
If you have experienced this, you have used version control, which according to Wikipedia
version control “is the management of changes to documents, programs, and other information stored as computer files.” But, if you have experienced anything like this, then you have also have come to deeply understand the need for a better and easier way to merge in any changes that come on an earlier version. Formal software systems that are designed for version control have many advantages over the kind of informal system that we just described.
A version control system (VCS) is a system that stores all of the versions of a project along with comments on those version that explain the reasons for the changes. A system that manages version control for software development is sometimes called a source code management (SCM) system, but we will typically use the more general term. In this chapter, you will learn the basics of version control.
This chapter is about version control with a focus on using Git for version control. We begin by discussing why you need version control, explaining some background on version control tools, move on to how to get Git running on your system, and finally we help you to start working with Git. By the end of this chapter you should understand why version control exists, why you should use one, you should be all set up to begin to do so, and you should have a basic understanding the most commonly used git commands.