Skip to content

Intro to git and GitHub: Labs

Sam Moorhouse edited this page Jun 15, 2018 · 11 revisions

Intro to git and GitHub: Labs

1: Create a GitHub profile

The first thing we want you to do is create your own GitHub profile. If you already have one, you can skip this step - go right ahead & fork the glblcd/introduction-to-global-code project in the next section!

  • Browse to github.com and sign up for an account. Fill out the form, and you're done!
  • You might want to upload a picture, too. Find one you like, or take one on your phone and email it to yourself, then upload it to github.
  • Find some software projects hosted on github that you've used in the past and star them.
  • Go to the glblcd repository in github and star it :)

2: Investigate github!

  1. Find a project that you know about: Look at its code, issues, and pull requests
  2. Find a project that you like and fork it. Clone it into your local repo!

3: Upload your own code!

Create a file called readme.md in your HelloWorld directory

  1. Add some text which describes what the project does
  2. Commit your change, then push to origin.
  3. Refresh the HelloWorld project page in your github account. What's different?
  4. Read about MarkDown and improve your readme!

4: Upload all your "Python Intro" answers

Remember the "Intro to Python" labs from the other day? Create a new github repo called "Intro_To_Python", then follow the instructions:

  • Initialise a local git repo in the directory where you kept your code
  • Add a new remote repository called origin
  • Stage all the files containing your answers (tip: what does ls *.py do?)
  • Commit your files, then push them to github (origin)
  • Refresh your web browser to see your code there!

4: Git questions

  • Make a change to a local file and stage it. What does git diff show?
  • What does git status -s do?

3: (Stretch)

  1. Look at the issues page for a project you like. Find a bug that needs to be fixed and have a go!