Skip to content

Instantly share code, notes, and snippets.

@arstagaev
Created July 28, 2020 19:12
Show Gist options
  • Save arstagaev/6959de5b0ebc0b01ea49b0c5b2130ff8 to your computer and use it in GitHub Desktop.
Save arstagaev/6959de5b0ebc0b01ea49b0c5b2130ff8 to your computer and use it in GitHub Desktop.
For git & get ssh key
git init
git remote rm origin
git remote add origin https://github.com/ArsMarsX/wt
git commit -m "initial commit"
git push origin master
//////////////////////////for commits///////////////////////////
git commit -am "my commit"
git push origin
git push --set-upstream origin master
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When ERRORS
git remote set-url origin https://github.com/ArsMarsX/MyWindTurbine2
~~~~~~~~~~~~~~~~~~~~~~~~GEN~KEY~SSH~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://coderwall.com/p/7smjkq/multiple-ssh-keys-for-different-accounts-on-github-or-gitlab
# all about multiply ssh keys
ssh-keygen -t rsa -b 2048 -C "email@example.com" # not work
Case 1: Multiple accounts on Github
Create SSH keys with different names
$ ssh-keygen -t rsa -C "your_name@home_email.com"
When you see this message
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user_name/.ssh/id_rsa):
Enter unique name, for example:
$ id_rsa_home
$ cat ~/.ssh/id_rsa.pub # for show public key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\
…or create a new repository on the command line
echo "# SolarForecasting2" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Ars4Mars/SolarForecasting-mark1
git push -u origin master
…or push an existing repository from the command line
git remote add origin https://github.com/Ars4Mars/SolarForecasting-mark1
git push -u origin master
...............
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment