Git uploads the local repository to the remote repository

Source: Internet
Author: User

Start a new project by building a new library in an existing Git repository and uploading the local git repository to the remote server's Git repository

first , create a new folder on the local ABC, enter into ABC, and then git init. This initializes a git project ABC locally.
then , log on to the remote git server, under the Gitrepo directory,mkdir abc.git. Then enter the Abc.git directory. git--bare init. This creates an empty Git project on the server side.
then , on the local, go to the ABC directory and add the remote repository. git remote-v displays the project's current remote repository because it is a new project, so the result is empty. git remote add Origin git://127.0.0.1/abc.git This adds the repository ABC.
finally ,commit commits the local code, andgit push origin master to upload the local git repository to the GIT repository of the remote git server.

Remote Direct local operation is also possible without logging in

1. Git init

2. Git Add.

3. Git commit-am "# # #"-------above 3 steps only local submission

4.git remote Add Origin [email protected]: Repos/xxx/xxx/xxx.git

5.git Push Origin local branch: remote Branch

Git uploads the local repository to the remote 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.