Gittyup Pyladies

Goals

You are done with this section when you

  • Have a Github account, and Git installed on your computer

  • Have a text editor (preferably Sublime Text)

  • Have checked out and commited an edit for the guestbook repo

Git

Git is a revision control system created by Linus Torvalds (the Linux creator) that stores all of the revision history locally as well as in the remote repository.

It's super-great for personal projects because it lets you go back to earlier versions of the code you write.

It's essential for coding as a team.

Github

is an online platform that hosts git repositories.

If you have done this already, just make sure you can use Git on the command line. And please help someone near you.

For your Github account

Sign up at https://github.com/ — pick a username that's not embarrassing to show employers.

For Git

The login screen shows steps in the Github bootcamp which get you started. Right now please do the following steps in Set up Git:

  1. Follow the download and install instructions for your OS
  2. Do the section Setting up Git and then click to the next slide
  3. If you finish before others near you please help them

Shell concepts

If you do not know what a terminal is, this short Git Bash Tutorial (3 minutes) is for Windows users but will help everyone enough for right now.

You can use the shell to

  • run commands
      help
      which git
      echo "foo\nbar\nbaz" > foo.txt
    
  • look at files
      head foo.txt
      wc -l foo.txt  # number of lines in a file
      grep bar *
    
  • navigate around your computer
      ls *.txt
      rm foo.txt
      cd /bin
      ls -1
    

And much more

Setup https authentication

We recommend https authentication not ssh authentication, and that you follow the linked instructions to set up the password caching feature.

Fork my test repo

Follow the instructions in the GitHub Bootcamp but use my guestbook repo instead of the example.

  1. Click on Fork, and GitHub will redirect you to your own account with the forked repo
  2. Copy the URL under HTTPS clone URL (on the right side)
  3. Open a terminal (or Git Bash for Windows), navigate to where you want to have your repository, and type
         git clone <the copied URL>
    
    If your Git is set up correctly (with the password caching) you should now have a folder called gittyup with the contents of your GitHub repo. If not, ask for help.

You will need an editor

We recommend Sublime Text. If you prefer Emacs, Vi, or another editor go right ahead and keep using that (but you might be glad you tried it).

Otherwise, please go to the Sublime Text download page, and download and install the correct version for your OS. We are intentionally using Sublime Text 3 because it has a command-line version for Windows.

Advanced coders may be interested in keyboard shortcuts (OSX, or Windows/Linux). They are by no means necessary to use Sublime Text.

↩ 'enter' ⇧ 'shift' ⌫ 'delete' ⌃ 'control' ⌥ 'option'

Command-line Sublime

It will be worth it to set up the command-line functionality for Sublime Text. I think this happens out of the box for OSX and Linux users. For Windows users, please follow these instructions. You can check that it works by typing

    subl

on the command line.

If you know how to set a path in Windows, chances are good someone else will be really grateful for your help — please look around!

Edit the repo

We will modify guestbook.txt. Just type the following on the command line to open it in the Sublime Text editor:

    subl guestbook.txt

Then make your change, save, and close.

Inspect and commit your change

See how Git helps you keep track of your work by typing in the shell:

    git status
    git diff

Then add your change to your local repo and push it to GitHub:

    git add guestbook.txt
    git commit -m'signed the guestbook'
    git push

Project anatomy

Most every project will have the following

  • README.md:  a markdown file to help orient a new person
  • LICENSE.txt:  the legal stuff about reusing and copying
  • .gitignore:  a list of files to exclude from the repo

The gittyup project also has an index.html that was set up to work with Github pages (every GitHub project is allowed its own static web site), and the guestbook.txt that contains the guest list displayed in the index.html.

Help

You can get help on options for the git command by typing this in the shell:

    git help

Optional: pull request

If you want to contribute to other open-source projects on Github, this is how you would do it!

  1. On the repo's page of your github.com account, click pull request and the review page will open
  2. When you are satisfied that your change is good, click create pull request
  3. Soon after I accept the pull request you should be able to see your message on the guestbook

Delete the repo (if you want)

but please wait until I've accepted your request...

  1. Navigate to your repo in Github
  2. On the right, click Settings
  3. Click Delete this repository at the bottom, and follow the prompts

Finished with this section!

Halfway done! You are ready for the install Python step!

Resources