Git basics: Use and submission of local code libraries

Source: Internet
Author: User

Git is a good thing, but for beginners, this tool is not good to use, because it involves a lot of things, and these things novice for a time is incomprehensible. Unfortunately, I am a novice, so, here does not say too much about the principle of git, what kind of stage should do what kind of things, first from familiar with the common use of tools to start.

To facilitate the use of Git, we first create a repository on the GitHub. We can create one on the GitHub on the basis of the tutorial, which is very clear here without steps.

I first create a remote library "Pratice" on the GitHub. Since I already have a remote library on GitHub, I need to create a new remote library for this new repository to prevent confusion when submitting files.

By default we have a remote library: origin, but through the above operation, now we have a new remote library: Pratice. And we can also rename them by rename.

Adding a new file to the branch with add and then commit,-m the following description is very important when we need to roll back the code version. If there is a problem with remote add origin, like the above, you can use a remote RM origin to purge the previously submitted remoting library, which clears the local remote repository. Then we push Origin master and push the contents of the master branch of the remote library up. If there is a problem here, you can use pull Origin master, which is the same as the remote RM origin above.

With the above command, we can now look at our repository on the GitHub:

Oddly enough, we just wanted to push the Pratice folder up, but we found that Bluetooth was also pushed up. This is because Mater has Bluetooth in this branch, so every time you push it up, you push the Bluetooth up.

Master is our default branch, and we can delete the branch and then create a new 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.