1. Open Terminal, enter
cd ~/.ssh
This is to check ssh
whether your existing, if present, the existing ssh
backup, or the new ssh
build to another directory (if the first configuration is generally nonexistent), does not exist, you will see the following:
Next you will need to use the default parameters to generate SSH, terminal input
ssh-keygen -t rsa -C [email protected]
Here is [email protected]
your registered github
email address, such as mine chw_l[email protected]
, then my terminal should be input
ssh-keygen -t rsa -C [email protected]
And then keep the carriage return until this
If you want to modify the ssh
build directory, enter the path to be generated in the bold location, and select default to generate the ~/.ssh
following
2. Open your GitHub and follow the steps below
Click on the new SSH key on the left and add
Above the
Title
: Fill in your registered mailbox number, this is [email protected]
key
: Fill in the contents of your generated id_rsa.pub
file copy
to this
/users/fengnovo/.ssh/id_rsa.pub Copy to go
Select text edit to open it.
3. Test your account with the github
connection. No, open the terminal, enter
ssh -T [email protected]
If it appears
Hi Loveway! You‘ve successfully authenticated, but GitHub does not provide shell access.
It means you're connected.
4.
Create a new git on GitHub
TouchReadme.md//Create a new document for the record submission operationGit init//initializing the Local warehousegit add readme.md//Addgit add *//Join all Projectsgit status//Check the status if all green proves successful.Git commit-m"First commit"//submit to the repository and write some notesgit remote add origin [email protected]:youname/test.git//connect to the remote repository and build an alias named: OriginGit push-u Origin Master//submit the contents of the local repository to the address that is origin, under the master branch
Error:
1.git commit-m ' Test ' appears with the following error
NPM ERR! Darwin 15.6.0npm Err"/usr/local/bin/node"/usr/local/bin/npm"Run" Lint"NPM ERR! Node V7.2.1NPM err! NPM V3.10.10NPM err! Missing SCRIPT:LINTNPM err!npm err! If you need help, your may report this error at:npm ERR>
.git/hooks
Delete all the files in the directory. Reference https://github.com/ruanyf/jstraining/issues/24
Reference links
Http://www.jianshu.com/p/3cc188964dbf
Https://apple.stackexchange.com/questions/93002/how-to-properly-update-git-on-mac
http://www.jianshu.com/p/e7501b968256
Http://www.07net01.com/2015/08/895617.html
Https://github.com/ruanyf/jstraining/issues/24
Git commits github code under MAC