CODING supports SSH and HTTPS protocol to access Git repository, here are the steps to use SSH to upload code
1. Generate SSH public key ( CODING official help documentation - Configure SSH Public Key)
Open Git Bash or other command-line terminal. Enter SSH-keygen -t rsa -C "[email protected]" (your mailbox), has been enter on it, so the public key can be stored in the default position, and no password
2. Add the public key
Id_rsa.pub editor to open a text file, log CODING, personal accounts => SSH public key => new public key, copy the contents of the file, put it inside the ok
git init | Initialization warehouse |
git clone [email protected]:xxx/design-pettern.git | The master remote repository to a local clone, create a master branch |
echo "# design-pettern" >> README.md | Create a file README.md |
git status | View Status |
git add . | add files |
git commit -m "first commit" | Upload (Remarks) |
git remote add origin [email protected]:xxx/design-pettern.git | Connect to a remote warehouse |
git push -u origin master | The master branch pushed host origin, as the default host specifying origin, directly after git push |
According to the above statement is executed after refreshing the page will be able to see their code. If there is no public key, the following reminders when executing the command: