Github and code
Setting up your computer to interact with GitHub
Get the Code (using git on the command line) in Linux and Mac
- Prepare a folder where you want to put the code.
mkdir <directory> - Change the permissions to allow you to read write and execute on that directory.
chmod ugo=rxw <directory> - Clone the repository from github (requires pi connected to the net)
git clone https://github.com/woodno/raspberry.git - Whenever you want to update your code use...
git pull
Get the Code (using git on the command line) in Windows
- 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 - You may need to install git for windows. https://gitforwindows.org/
- Go to a directory you have created ready to hold your python code.
- Download the code with...
git clone https://github.com/woodno/raspberry.git - 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)
- Generate a ssh key
$ ssh-keygen -C "your_email@example.com" - Copy the generated file text....
cat ~/.ssh/id_ed25519.pub - 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 - 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
- Code available as zip at https://github.com/woodno/raspberry/archive/refs/heads/master.zip
- Individual examples at https://github.com/woodno/raspberry
- Python tutorials at W3Schools
- Location of GPIO library help
Comments
Post a Comment