Git Notes - goldpot/scripts GitHub Wiki

  1. First create your SSH keys (Secure shell protocol)

  2. ssh-keygen -t -rsa -C "[email protected]" --> could be any string (try it) Generating public/private rsa key pair Enter file in which to save the key(/Users/u/.ssh/id_rsa): Enter passphrase(empty or no passphrase): Enter same passphrase again: Saving key "/.ssh/id_rsa" failed : no such file or directory --> this is because there is no directory in the home () called ssh , "." in .ssh means hidden files .

  3. create a dir called .ssh --> mkdir ~/.ssh

  4. now go into .ssh dir --> cd .ssh

  5. .ssh ssh-keygen -t -rsa -C "[email protected]" Generating public/private rsa key pair Enter file in which to save the key(/Users/u/.ssh/id_rsa): Enter passphrase(empty or no passphrase): Enter same passphrase again: Your identification has been saved in id_rsa. Your public key has been saved in id_rsa.pub.

  6. .ssh ls --> list all files in .ssh directory to check if you have the two keys id_rsa id_rsa.pub known_hosts

  7. now open the public key id_rsa.pub by cat id_rsa.pub --> copy the contents and paste it onto your github account settings ( new public key there)

  8. This step will authenticate your github account

  9. now in the ssh directory do a -- this will test the SSH key setup -> .ssh ssh -T [email protected] Hi awesome! YO've successfully authenticated , but github does not provide shell access

  10. Now clone your github repo ( which you have previoucle created in your github account)

  11. my_project git clone [email protected]:yourgithubid/react_python.git cloning into react_python

  12. my_project cd react_python Once you have cloned now lets try to add a readme.md file

  13. react_python git:(master) touch readme.md

  14. This will open up a readme.md file in nano editor( my set up)

  15. type out what you intend for the project to do. 16 ctrl o + enter in nano editor to save the file

  16. now do a git add readme.md

  17. this will add the file into the staging area of the repository

  18. now let's add a commit with an initial comment - git commit -m "feat:first commit"

  19. do a git status to ensure you see "working tree clean " message

  20. git push --> this will push your local repo changes to remote repo