Skip to content

Instantly share code, notes, and snippets.

@alyssafrazee
Created August 20, 2014 20:59
Show Gist options
  • Save alyssafrazee/db2c562cd43b048d19d2 to your computer and use it in GitHub Desktop.
Save alyssafrazee/db2c562cd43b048d19d2 to your computer and use it in GitHub Desktop.
intro to github

starting a new project

  1. Make a repository on GitHub. Check the box that says "initialize this repo with a README."
  2. Clone that repository on to your computer. That's git clone + the ssh URL you can find on the right-hand side of the repository. Go to the directory where you want the repository_name folder to live.
  3. Run a git status as a sanity check. (Everything should be clean).
  4. Write some code!
  5. Run a git status again. See that your code now lives in your repository, but hasn't yet been added to version control. (the file names should be red in your terminal)
  6. "Add" (git add) the code to version control.
  7. Run another git status. The file names should now be green, meaning they've been added to the version control staging area, but not committed to your repository's history.
  8. Commit your changes with git commit -m 'message_here').
  9. Run another git status. It should show that your directory is clean, but that you're ahead of the remote repository (GitHub) by one commit.
  10. Push that commit to GitHub with a git push.
  11. Celebrate! You've written code, checked it in to git (version control), and pushed it to GitHub. Most excellent!

more complicated things

Beyond statusing, adding, committing, and pushing, you may also want to know about pulling, branching, reverting, and other such fancy things. I leave these adventures to you! :)

resources

I like this guide for a beginning reference. I also use Stack Overflow very, very often. GitHub help. This git reference manual is also quite excellent (but covers only git, not GitHub or other places you can put your repos online).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment