Upload a local project or code to someone else's GitHub (Code cloud) remote Branch

Source: Internet
Author: User

Today, I encountered such a problem, tossing a half-day, is to upload their own local code to someone's remote branch.

The first thing to do is to clone someone else's project to the Local: Git clone + project address

Then go to project directory: CD + cloned project directory name

Then switch branches, git checkout + branch name ( must have the same name as the remote branch of the code you want to commit )

Then copy the code that you want to commit to the branch, and then click Execute

(1) Git Add. (Note: There is a space between the add and the period, otherwise it will be an error)

(2) Git commit-m "Change Log"

(3) Git push origin + remote sub-well-known

  The first time you do this, you may be asked to enter a user name and password, and note that the user name and password are entered at this time

Upload a local project or code to someone else's GitHub (Code cloud) remote Branch

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.