Git's first experience remote repository

Source: Internet
Author: User
Tags version control system

Git is a powerful, open-source, distributed version control system that can be used for agile and efficient processing of any or small or large project.
Here's a great tutorial on getting started with Git, which is a good tutorial for getting started with git.
Add a remote repository GitHub started out a little more trouble, I was just getting into the pit for a long time, a lot of bugs. This is the code that runs under the local repository:

$ git Remote add origin [email protected]:xuchaoxikb/onlineshop_jsp.git

It shouldn't have been a problem, but

Because I've already built a repository that's connected to GitHub, so this is going to happen, so just remove origin from the code:

$ git Remote RM origin

And then enter:

$ git Remote add origin [email protected]:xuchaoxikb/onlineshop_jsp.git

However, if you enter: $ git Remote RM Origin or error: error:could not remove config section ' Remote.origin '.

You need to modify the contents of the. gitconfig file,. Gitconfig is a git configuration file with User.Name and User.email. The path is usually under C:\Users\Administrator. Find a file named. gitconfig and open it and delete it from the line [remote Origin].
You can then use the git push command, and if it's the first time you push the master branch, git push-u Origin master will immediately push the local repository project to GitHub, but

It's a mistake again. This error means that the remote repository has been modified, it may be that other developers have push before you push, so just pull the remote repository to the local repository, command line git pulling Origin master and then enter the git push -U Origin master is available. Finally, the local repository was successfully pushed to the remote repository.

If the home is on fire, the first commit, the second push.

Git's first experience 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.