Generate Key:
ssh-keygen -t rsa -b 4096 -C "name.surname@gmail.com"Ensure SSH agent is up and running:eval `ssh-agent -s`Add SSH key to ssh-agent:ssh-add ~/.ssh/id_rsaInstall command line clipboard manager so the content which should be copied to the clipboard can not be copied incorectly:sudo apt-get install xclipCopy the content to clipboard:xclip -sel clip < ~/.ssh/id_rsa.pubGo to https://github.com/settings/keys and press [New SSH key], write the name and paste the content:
Make sure the git is installed on Raspbian operating system:
sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install git -yLet's create new repository in live environment with project name "rpi-stretch":curl -u 'catonrug' https://api.github.com/user/repos -d '{"name":"rpi-stretch","description":"auto configuration"}'Let's create local the directory which will go on the internet:mkdir ~/rpi-stretchLet's go inside this project directory:cd ~/rpi-stretchTell the computer that is supposed to be a git repository:git initTell the computer where this repository equals online:git remote add origin git@github.com:catonrug/rpi-stretch.gitAdd all files in project:git add .Create a commit. Calculate if there is any difference:git commit -m "first"after this command I can get:*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for <(null)>) not allowedAs it can see I need to enter github credentials here:git config --global user.email "name.surname@gmail.com"
git config --global user.name "catonrug"Make changes online:git push origin masterAll done. If I miss the first step off SSH key upload then in this situation I will receive:Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.To debug this situation I can use:ssh -vT git@github.comAfter all, at first, I have to create SSH key and upload to GitHub.Can in it done with GitHub API? You tell me ;)
No comments:
Post a Comment