GitHub is a “social coding” service that offers web-based source control using the Git revision system. One of the appealing features is that you can host unlimited public repositories with a free account, which is perfect for my needs. I’ve wanted to look into it for a while as a way to host and share code that I write for many of the various projects that I write.
Getting Started
So I was finally ready to start using GitHub. I went to github.com, created a new free account, and created a new repository. It was all intuitive and seemingly very easy. But then I got stuck. I was looking all over for some sort of “upload code” link that would let me pick some files to be uploaded to the new repository. It didn’t exist. I was stuck.
The problem is that I didn’t take time to understand exactly what GitHub is or how it worked. I was trying to work through the bootcamp tutorial, and most of the steps were entering commands into a Unix-like prompt. That’s the point when I started to read more carefully and found that I needed to install Git locally, create a local repository, and then commit changes to the web repository. I was still just blindly entering commands into the prompt, not really understanding what I was doing, though.
I was struggling, but I somehow managed to stumble upon GitHub’s own Windows offering: GitHub for Windows. It got a lot easier at that point. GitHub for Windows is a polished, intuitive application. Using it, I was able to create my local repository, push it to GitHub, commit changes locally, and sync to the web. It was incredibly easy!
Tutorial
Using GitHub is really easy once you know what you’re doing, but it wasn’t quite as intuitive to figure out as I would’ve expected. Now that I have it (somewhat) figured out, I wanted to create a straightforward, barebones tutorial to help guide the masses. Note that this tutorial is based on my own experience in Windows.
- Create a new GitHub account at github.com
- Download and install GitHub for Windows from windows.github.com
- Start GitHub for Windows
- Create a new local repository
- Note the “Push to GitHub” option. If you select this, the repository will be created using the credentials you provide. If you don’t select this option, you can push it to GitHub later by clicking a button on the repository details page.
- Put some files in your local repository
- Just copy files into the local repository directory!
- Commit changes locally
- Double-click the local repository or click the arrow next to the repository to open it
- Add a commit message and click COMMIT
- Publish changes to the server
- When you click the Publish button, your files will be uploaded to the web repository
- After the initial publish, the button will change to “Sync” which can be used to upload additional local changes or retrieve changes made by others
That’s all there is to it. After your changes have been published, the code will be accessible through GitHub at https://github.com/%5Busername%5D/%5Brepositoryname%5D. You can get to your repository from GitHub for Windows by right-clicking the repository and choosing “view on github.”