Join James Williamson for an in-depth discussion in this video Version control overview, part of GitHub for Web Designers.
At the core of Github is Git, which is, as it says, a distributed version control system, and in this chapter, we're going to learn some of the basics of Git before we get into actually using Github itself. Now, I'm sure there's some of you out there that have sighed very loudly or thrown, you know, maybe a book into the wall because you were probably saying, "Hey, I came specifically to the GetHub four web designer course so I wouldn't have to learn all th is programming stuff." Now the fact of the matter is if you don't know how to use git or at least the basics of it, you're not going to be very efficient or be very successful at using GitHub.
I know because I tried. I tried to learn GitHub without touching Git at all and I messed a lot of stuff up. So, what I want to do is I want to present the basics of Git to you, show you how easy it is to master some of the basic commands. So that as we move into learn and git hub, you understand the concepts behind what it is that we're doing. So, don't panic. This is going to be pretty easy. So, let's turn our attention back to the whole distributed version control system here. I'm on Git's homepage, which is git-scm.com, and it talks about how it's an open source distributed version control system.
Okay. So what is that? Well, to show you what that is, I'm first going to show you what it's not. This is an actual project folder from one of my projects and this is actually an icon font that I'm working on. And as you can see, I have version one, version two, version three, version four. There's some final, some other sort of trash sitting around, and I am not proud of this, but I am willing to bet that there are several of you out there right now that are working in exactly the same manner, or at least something similar.
So what version control will do for us is it can make this process a lot less painful. At it's most basic, it tracks the changes to projects over time so that you can check progress or revert to a earlier version a little later on. Having software do this for you automatically can save you a great deal of time and usually prevent you from loosing work from over writing or inervertintly deleting files. There are two main types of version control software. Centralized and distributed. A centralized version control system will maintain a central repository for project files that individuals can then check out to work on and then check back in when they're finished.
If a file's already checked out, in most centralized systems, they won't allow other collaborators to work on it until that file has been checked back in, and this is to prevent files from being overwritten inadvertently. And it helps maintain a single centralized repository for these project files. Popular centralized version control systems are Subversion and CVS, and you may have seen or heard of them before. Now, Git is what's known as a distributed version control system. Now in these systems, each client keeps a local mirror of the project repository.
Depending upon how the work flow is established, individuals can either push changes to other repos, pull changes from other repos, or synch changes between multiple repositories. The value of this distributed approach is that if any of the individual mirrors are lost, simply cloning another client can restore them. In a centralized system, the failure of the remote server could mean the loss of all of those project files. It also allows more freedom among collaborators, as they're free to work on changes individually, and then push those changes to the remote repository when it's appropriate.
Understanding the distributive nature of Git will help you understand how it works and all the workflows that are associated with it. As I mentioned in this chapter, I'm going to introduce you to Git and run you through the basics of how it works. Now most Git tutorials that I've seen assume that you're a programmer or that you're already fluent with version control terminology and commands. This was really frustrating for me as I learned Github, so I'm going to try to make it a little bit easier for someone who's a designer and not a developer to understand.
- Creating an account
- Installing GitHub
- Git basics
- Adding files to Git
- Checking differences
- Creating, switching, and updating branches
- Creating a new GitHub repository
- Managing files with the GitHub client
- Working with collaborators
Skill Level Intermediate
Q: Why can't I create a .nojekyll file?
A: Depending upon your operating system and platform, you may have certain restrictions which make it impossible to create a .nojekyll file through Finder or Windows Explorer. Usually you’ll receive an error message that informs you that files starting with a “.” are system files and that you lack the permissions necessary to create one. If that’s the case, you’ll need to create the file through a Terminal window or bash prompt. Here’s how you do it:
1. Open a Terminal window if you’re on a Mac, or the bash prompt from the Github client if you’re on Windows.2. Navigate to the repository’s root directory.3. Type the following at the prompt: $ touch .nojekyll4. That’s it! The next time you make a commit and push to the master branch you should see your new .nojekyll file.