Here are ways to add ssh key in Github, such that one can connect to github repositories without typing username and passwords.
For MAC Users:
To create an SSH Key, go to your terminal (or iTerm 2) and enter ssh-keygen
. You will be prompted for a file in which to save the key (.ssh/id_rsa). There’s no need to enter anything, just press enter. When prompted for a passphrase, you can enter one or just press enter to ignore creating a passphrase.
Your SSH key has been saved to ssh/id_rsa.pub, run the command pbcopy < ~/.ssh/id_rsa.pub
to copy this to your clipboard.
Now go to your Github account setting for Key: https://github.com/settings/keys and click ‘New SSH key’. Add any title you want, like ‘First SSH Key’, paste in your SSH key, and click the ‘Add SSH key’ button.
For PC Users:
To create an SSH Key, go to your terminal and enter ssh-keygen
. You will be prompted for a file in which to save the key (.ssh/id_rsa). There’s no need to enter anything, just press enter. When prompted for a passphrase, you can enter one or just press enter to ignore creating a passphrase.
Your SSH key has been saved to ssh/id_rsa.pub, run the command cat ~/.ssh/id_rsa.pub
to see your SSH key in the proper format. Copy the whole text string starting with ‘ssh’ to the end.
Now go to your Github account setting for keys: https://github.com/settings/keys and click ‘New SSH key’. Add any title you want, like ‘First SSH Key’. Paste your SSH key to the Key window, and click the ‘Add SSH key’ button.
There are a lot of complex functionalities of Git, but for 99% of work there are 4 things that you need to be able to do:
Create a branch
git checkout -b my-branch-name
Add files that you want to queue up for saving.
To add all files:
git add .
To add a specific file:
git add path-to-file
Save (commit) changes to the files that you added above.
git commit -m "message about this commit. Ex: change button color to green."
Sync your branch to Github so that you can later make a pull request.
git push -u origin my-branch-name