Quick Git and Github - JasonLocklin/jasonlocklin.github.com GitHub Wiki

###Git octocat Git is Free Software that runs on your computer and takes snapshots of files in a directory, stores a well documented history, and permits collaboration and syncing (optionally with a service like Github). The basic git software runs from the command line, but there are graphical versions available, including one provided by Github.

Git can manage any type of file, but shines with small-ish sized, rapidly changing files (i.e., data files more than a few dozen MB should not be stored in git). Many of it's powerful features work best with plaintext files, so it is perfect for managing projects with source code and plain text documents (including HTML or other markup files). Documents written in word processors can also be versioned as well, but for detailed history, you will want to use an integrated "track changes" feature.

Using version control software as part of a work-flow takes a little extra effort. For every significant chunk of work done, you should commit your work to git, and include a short description. This may seem like more work than something like dropbox, which just takes snapshots automatically at various times, but the end result is much better documented history. With git, you can take a single line of text or code, and learn exactly when, who, and for what purpose that specific line was added. Perhaps more practically, git allows you to switch to versions of files that have some sort of meaning -like experiment code that was used to run a particular group of subjects. No more analysis.june14.txt, analysis.june30.txt, manuscript_old.doc, manuscript_edited_by_j.doc, etc. Just cleanly organized files with a full history available.

###GitHub octocat Github is a website that makes use of git to provide easy browsing of files, versions, and projects. It also provides powerful collaboration features. It can save files in private repositories, or publish them. There are thousands of such public repositories on Github, with everything from operating systems to small data analysis scripts. Not only can you browse these projects, but you can copy them to your own project, edit them, and optionally forward your changes back to the original owner. Collaborators can work closely with a single repository and have thorough documentation of who wrote what, when, and use a variety of collaboration tools. Alternatively, collaborators can work on two separate but related projects, using pull requests to share useful updates. Github also provides special versions of the git software for Windows and Mac users that is designed to be simple to use and automatically integrate with Github. Github also provides gists, which are a sort of "light-weight" repository for easily working with a file. This document, for instance, is a gist.

Note: Students and teachers can get GitHub's "micro" account for free (private repositories). Sign up with your educational email address, and then go here

Setting Up and Using Git

See the "bootcamp" article for instructions on downloading the git software and setting things up.

Git Terminology:

  • Repository: A Project
  • Commit: A project snapshot, with a short description
  • Clone: Create a new working copy
  • Push: Send recent changes
  • Pull: Get most recent changes
  • Fork: Make a copy of someone else's public project
  • Pull Request: Notify original owner that you have made changes the he/she may want

This page is permanently accessible at http://git.io/quickgit.

⚠️ **GitHub.com Fallback** ⚠️