I recently attended a GitHub workshop at the Boulder Github office. The wonderful thing about Boulder meetups is that they’re full of great people, the food is usually pretty good (yay taco bar!), free drinks, and you learn something too.
The GitHub staff put together a great Meetupsession with stories of personal journeys that tied in with the experience they wanted attendees to gain through their tutorials. After a brief explanation of what Git and GitHub are all about (wait… Git? Is that the same as GitHub? Nope! Don’t worry… I’ll explain in a minute) we were encouraged to follow one of two tutorial paths available through Git-it.
With the assistance of attendees who signed up as mentors (having a thorough understanding of how Git works… ), we were given a chunk of time through which to work through the tutorial of our choosing at our own pace.
Git is free open source software (the source code is public) written by Linus Torvalds who also wrote the Linux operating system. Git is a program for keeping track of changes over time, known in programming as version control.
After verifying that you have git installed and configured properly, the tutorial walks you through creating a repository on your computer.
A repository is a collection of related items. In our case, when writing software, it is a collection of files related to a software project. You can imagine it as a project folder with all the relevant files inside of it. In fact, that’s what it will look like on your computer anyways. Sometimes they’re called “repos” for short.
So now you’ve used Git via your command line to create a local (located on your computer) repository, you can create and edit the folders and files within your repository by using commits.
Commits are core to using Git. They are the moments in which you save and describe the work you’ve done. They are the ticks in the timeline of your project’s history.
If you have a GitHub account already established, great, if not then it’s time to set one up!
GitHub is a website that allows people everywhere to upload what they’re working on with Git so that everyone can easily work together on the same project. GitHub which acts as the central repository for you and everyone else to share. You push your changes to it and pull down changes from others.
Now that you’ve got that all set up, you’re ready to push and pull changes from a remote repository.
When you put something on GitHub that copy lives on one of GitHub’s servers. This makes it a remote repository because it is not on your computer, but on a server, “remote” and somewhere else. By pushing your local (on your computer) changes to it, you keep it up to date.
Others can always then get the latest from your project bypulling your changes down from the remote (and onto their computer). This is how everyone can work on a project together without needing access to your computer where your local copy is stored.
Want to work on a collaborative repo? Check out branching!
Git repositories use branches to isolate work when needed. It’s common practice when working on a project or with others on a project to create a branch to keep your working changes in. This way you can do your work while the main, commonly named ‘master’, branch stays stable. When the work on your branch is finished you merge it back into the ‘master’ master branch.
At the end of the tutorial I successfully had contributed to the GitHub patchwork repository which appears on my GitHub profile along with all of my repositories and other contributions.
“Knowledge is a treasure, but practice is the key to it.”
-Lao Tzu –
- All block quote descriptions are pulled from the Git-it tutorial.*
Check out more of my writing at Powered By Prana