All my slides and material that I use in class can be found on my GitHub site.

# Update the package list, update all packages and remove any packages that are no longer required on your Raspberry Pi
sudo apt-get update -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y

Creating a repository

  • First create a new repository:

echo "# sensehat" >>
git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master
  • Tell GitHub who you are:

git config --global ""
git config --global "Your Name"
  • Generate a new SSH key

ssh-keygen -t rsa -b 4096 -C ""

Press Enter to set a default file location. When asked to Enter passphrase …​, provide a safe password.

  • Add new SSH key to your GitHub account

    • Copy the SSH key to your clipboard


cat ../.ssh/
# assuming that the current folder is /home/pi/sensehat

Copy the key and paste it into GitHub

  • Push your first commit

git commit -m "initial commit"
git push origin master
  • Putting all the commands into a sequence:

git add *
git commit  -m "description of commit"
git push



  • Get changes on GitHub back to your computer

git pull origin master
  • Check all new commits

git log
  • Switch branches back to the master branch

git checkout master
  • Commit new changes

git add *
git commit -m "write a short comment here"
git push