Upload a local repository to a remote git repository

Source: Internet
Author: User

Many times we have created a project locally, and we want to use Git to upload the code to prevent accidental loss of code after the project has gone through a phase. At this point we need to know how to upload a local project to a remote Git repository.

Most of our daily life is to pull items from a remote git repository to local, and then upload them when the changes are complete. This process is believed to be familiar to everyone, so I wrote this blog specifically to provide beginners with a way to upload local items to a remote git repository.

Here are the specific steps:

1. Establish a repository in the remote repository

2. Executing in a local project: GIT init initialization project

3. Associate the local warehouse with the Remote warehouse: (Here the local project name is called User-interface-test)

git remote add origin [email protected]:xin.shen/user-interface-test.git

Note: Replace the warehouse address with your own warehouse address

4. Submit the Local code:

1 git add-A2" commit code "

5. Push the local project to the remote repository:

Git push-u Origin Master

Upload a local repository to a remote git 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.