Code Escrow Address: Https://git.oschina.net (Chinese version of GitHub)
1: Register an account in Https://git.oschina.net
2: Add SSH public key, use SSH public key to make your computer and Git@osc communicate with the use of secure connection (git remote to use SSH address).
3. Create a new project.
4: Add SSH public key.
The command to add a public key, as shown in the following illustration:
SSH Keys
To generate Sshkey, follow these commands:
Ssh-keygen-t rsa-c "Xxxx@163.com"
The default address is under the C:\Users\Administrator directory, copying Sshkeys to the public key header
Cat ~/.ssh/id_rsa.pub
Generate the public key header as the default address.
After adding, enter in the terminal (Terminal)
Ssh-t git@git.oschina.net
If you return
Welcome to Git@osc, huchun!
Then prove the addition of the project.
4 Add the public key to Git.oschina.
First: Clone a project from Https://git.oschina.net to local
1:clone the order of the project; git clone https://git.oschina.net/huchun/android.git
2: Submit to the local Project Server with the following command:
git Add. Committing the code to a buffer
Git commit-m "First name"
Git push origin master//submit code to server
Next follow the prompts to enter your user name and password
If you feel the hassle of entering a password every time, you can add instructions in the. gitconfig file.
Of course there are some problems in the submission:
1:error:failed to push some refs to. git
This problem occurs because the Readme.md file is not added in the directory, so you need to add
Git pull–rebase Origin Master
2:fatal:unable to connect to Eagain.net
This problem occurs when you get an error from Eagain.ney clone
Workaround: Git clone https://git.oschina.net/android.git
3:fatal:interactive git shell is not enabled
This problem requires sudo vim/etc/passwd
After saving the changes, use the following command server:
SSH Git@gitserver
If there is any problem, please follow my public number and keep on talking!