How do I use git to upload code to the coding code repository?

Source: Internet
Author: User
Tags git clone


1. Download a git software and install it on the Internet


2. Generate SSH
Right-click on the desktop, choose Git Bash here, go to the operator interface, enter "Ssh-keygen-t rsa-b 4096-c" *********@***.com (mailbox at coding.net registration) "" Command.
The next step is to change the new text document name to "Id_rsa", continue with the setup password, and then enter the command "cat ~/id_rsa.pub" to generate the SSH

Open ssh with a text document to get the key, copy the contents, and then in the account settings in the coding.net to paste the contents of the SSH, the other self-setting is good. This completes the configuration.

3. Create a local warehouse
Create a folder locally as your local repository for uploading code, and then configure the repository with the coding server side.
Right click inside this folder and choose Git Bash here, first initialize the local repository and enter "Git init".
Then open coding.net the address of the code warehouse that you created inside the copy, enter in git the command "Git clone + warehouse address (right mouse paste)", Example: http://*******
This will be the coding.net in the code in the repository of everything in the clone in your computer (note: see if you can use the CD to enter another disk, or the default clone on the desktop)

4. Code push
Put the files that you need to upload into the cloned folder, and then check the Repository status command "Git status" by using commands in Git to enter the folder.
If the file is not on the coding.net, the font will appear red, with the command "git Add." Select all uploaded files.
After completing the above steps, enter the command "Git commit-m" to identify what the file comment is "",
Then enter the "Git Push Origin Master" command to push to the cloud, origin is the server, master is the branch.


5. Code download
Once you have cloned the previous data, and someone else uploads some new files, you can use the command "Git pull Origin master" to update the latest repositories.

How do I use git to upload code to the coding code repository?

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.