Git's code hosting in Git.oschina and how to solve common problems

Source: Internet
Author: User
Tags ssh hosting git clone git shell


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!





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.