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
更多精彩文章:
https://datasciencebyexample.com/
datascience tribe

本文指导用户如何在Mac和PC上创建SSH Key,并将其添加到GitHub账户,以便安全地进行版本控制操作。步骤包括在终端中生成SSH Key,将Key复制到剪贴板,然后在GitHub设置中添加Key。此外,文章还简单介绍了Git的四个基本操作:创建分支、添加文件、保存更改和同步到GitHub。
958

被折叠的 条评论
为什么被折叠?



