1, the first set up GitHub remote Warehouse "own Baidu, online have a bunch";
2, download the gitbash installed well;
3, into the Gitbash command console, Remote Storage cloning;
Use commands are:
The clone address at the back of git clone https://github.com/XXXXXXXXXXX/XXXXXXXXXX.git//can be found in the GitHub project that you have built, "select Usehttps when choosing Clone"
Wait for the git command to complete the remote code cloning, you can build in the local warehouse inside the clone to see the code;
At this point, you can make your own local code changes to write;
Continue with the following steps when writing is complete;
4, use Git status to see the changes you want to submit "such as a new Readme.txt file," will appear in the following figure:
5, Next is the submission step:
git add readme.txt
git commit-m ' xxxxxxxxx '//later xxxxxxxxx is for versioning, you can add log records at commit
git remote add Origin https:// Github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git
git push Origin master
If you do git remote add Origin https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git, an error occurs:
Fatal:remote origin already exists
Proceed to the next step:
Git remote RM origin
and continue with Git remote add Origin https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git
If push is an error:
error:failed to push som refs ....
Continue using the following command to upload:
Git pull Origin Master
6, a point to note the use of HTTPS link "https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git" for cloning and uploading if the file is too large may occur timeout "Fatal:the Remote end Hung up unexpectedly "You can modify the URL at this time to upload using ssh:
STEP1:
Ssh-keygen-t rsa-c "email@domain.com"//Generate a Sshkey based on your mailbox
Once the build succeeds, a private key is saved locally and the public key is placed on the Gitlab:
STEP2:
Cat ~/.ssh/id_rsa.pub//After execution appears to indicate success Ssh-rsa AAAAB3NZAC1YC2EAAAADAQABAAABAQC6ENTGPNGWSTC ....
STEP3:
modify git URL to ssh in remote repository: "Git@server:username/project.git"
Git remote Set-url origin git@gitserver:username/project.git