Using git and GitHub

Using git for the CS101 Contest:

  1. If you don't have a GitHub login, get one and log in.

  2. Fork the GitHub udacians/udacity repository.

    It is located at:

    Point and click the "Fork" button.

  3. Clone the fork to your local machine. Be sure to change directory to where you want to work.

    git clone

    Substitute your GitHub login for github_login_name.

  4. Taken from Github documentation:

    cd udacity

    (Changes the active directory in the prompt to the newly cloned "udacity" directory)

    git remote add upstream

    (Assigns the original repo to a remote called "upstream")

    git fetch upstream

    (Pulls in changes not present in your local repository, without modifying your files.)

  5. Create a new branch.

    git branch your_branch_name

    Substitute your desired branch name for your_branch_name.

  6. Switch to your new branch.

    git checkout your_branch_name

  7. Make changes to the code.

  8. When you're happy with the code:

    git commit -m "I changed foo to bar..."


    git commit -a

    and enter the changes in the text editor that should pop up.

  9. Push the changes back to your GitHub repository.

    git push origin your_branch_name

  10. You will now have a shiny new branch on GitHub. Then pushed the "Pull Request" button to let people know you've got code.