1 download git for Windows first
Then always click Next to install.
2 after installation, select Git GUI. Generate SSH link git public key.
You can also use the command:
$ ssh-keygen-t rsa-c "[Email protected]"
then enter the password.
Suggested in the first way. The second kind of online says yes, but I didn't make it.
then enter the password.
3 Add a public key to open source China, or GitHub
Create a new public key in open source China and copy the contents of the id_ras_pub in the. SSH folder to the text box, where the title is optional.
4 Test Links:
Input command: $ ssh-t [email protected]
Then enter Yes
If successful, you can see your user name and mailbox.
Error can be tested: $ SSH-TV [email protected]
5 Setting the user name and mailbox
$ git config user.name "you name"
$git config user.email "[email protected]"
6 then create a project in Web open source China.
7 Test Upload file
To create a folder, you need the same name as the projexct you created.
mkdir Hello
CD Hello
Git init
Touch README
git add README
Git commit-m ' frist commit '
8 Submit
git remote add test [email protected]:web user name/hell.git
git push-u Test Master
If there is an error in the report:
to [email protected]:yangzhi/hello.git! [Rejected] Master-to-master (fetch first) error:failed to push some refs to ' [email protected]:yangzhi/hello.git ' hint:updates wer E rejected because the remote contains work, which you dohint:not has locally. This was usually caused by another repository pushinhint:to the same ref. Want to first merge the remote changes (e.g.hint: "Git pull") before pushing Again.hint:See the ' Note about fast- Forwards ' in ' git push--help ' for details.
You can enter:
Git push-f
Okay, OK.
10 Cloning Code
git clone [email protected]: User name/project name. Git
Source: http://www.xuebuyuan.com/651322.html
git submits remote error [rejected] Master--master (fetch first)