Join Michael Lehman for an in-depth discussion in this video Installation and setup, part of Learning Software Version Control.
Okay, let's roll up our sleeves and do a little Source Code Control with Git. Git is a distributed Source Code Control system. That means that you host the entire repository on your development box and other people host the same complete repository on their development boxes, and you can exchange files back and forth. It also means that you can use things like GitHub, which is a cloud-based service to host repositories in the cloud in order to save your work off of your development system, if you're working by yourself. Git is free. You can get the bits from git-scm.com.
And you can use GitHub if your product is open-source to have free-hosting. If your project is not open-source, you can have private repositories on GitHub for a very reasonable price. That's what I use on a regular basis, also at github.com. And they also have their own custom GUI application for both Windows and Mac that allow you to easily manage your local repositories and syncing to your repositories on GitHub and keeping the two of them connected together. All right.
So let's dive in and install Git. Okay, let's roll up our sleeves and do some Source Code Control using Git. The link for the Installation Binary is in the Links.rtf file in the exercise files directory. We're using the Git Installer from the git-scm.com website, which is the main home of Git, and it's a very forward MSI. This is the very latest one as of the time that we're recording this course. And we can put it wherever we want.
And we're going to choose Run Git from the Windows Command Prompt, because it works best with our recording setup here. If you're a Mac person or a UNIX person working on Windows, you probably want to Use Git Bash only, and then you have a very familiar command shell. In this case, we're just going to click Next. And in our case, because again we're using Windows, we're going to use Checkout Windows-style and commit Unix-style line endings. That allows us to use this repository easily with Macintosh users and Linux users.
If you're going to use Windows only, then you can click this Checkout as-is commit as-is. All this affects is what is stored in the repository, not what is in your working set. So when in your working set you always have carriage return line feeds, it just strips out the carriage returns when it checks in and reinserts them when it checks out for textual files. Unzip a bunch of Git stuff, we're all set, we don't need to look at the ReleaseNotes, and the way we can find out if we've actually got Git installed, first of all, you can see the icon here for the Git Bash shell, if we wanted to use it.
And we'll open up our Command window and say git --version, and you'll see something like this. Now, your version maybe different, but if you get a message at all like that as opposed to command not found, you know you've got Git successfully installed. All right. Let's move on to creating your repository and doing some checking in and checking out.
- Comparing centralized vs. distributed systems
- Saving changes and tracking history
- Using revert or rollback
- Working with the GUI tools
- Using IDE and shell integration
- Installing different systems
- Creating a repository
- Tagging code
- Branching and merging code
- Selecting a software version control system that's right for you