Github and code

Setting up your computer to interact with GitHub 

Get the Code (using git on the command line) in Linux and Mac

  1. Prepare a folder where you want to put the code.
    mkdir <directory>
  2. Change the permissions to allow you to read write and execute on that directory.
    chmod ugo=rxw <directory>  
  3. Clone the repository from github (requires pi connected to the net)
    git clone https://github.com/woodno/raspberry.git
  4. Whenever you want to update your code use...
    git pull

Get the Code (using git on the command line) in Windows

  1. Find out if you have git installed by opening a console and typing 
    git --version
    If this works you have git installed.  If not follow step 2
  2. You may need to install git for windows. https://gitforwindows.org/
  3. Go to a directory you have created ready to hold your python code.
  4. Download the code with...
    git clone https://github.com/woodno/raspberry.git
  5. Whenever you want to update your code use...
    git pull



Using ssh to login (Only use this if you want to make suggestions to modify my code and you already have a git account)

 (This is more for interest or if you wish to fix my code)
  1.  Generate a ssh key
     ssh-keygen -C "your_email@example.com"
  2. Copy the generated file text....
    cat ~/.ssh/id_ed25519.pub
  3. Add the ssh text to your github account
    https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
  4. If necessary modify the remote address to a ssh one (only if you cloned from a https)
    https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories#switching-remote-urls-from-https-to-ssh or to clone with ssh from scratch...
    git clone git@github.com:woodno/raspberry.git

Other links

  1. Code available as zip at https://github.com/woodno/raspberry/archive/refs/heads/master.zip
  2. Individual examples at https://github.com/woodno/raspberry
  3. Python tutorials at W3Schools
  4. Location of GPIO library help





Comments

Popular posts from this blog

Week 5