Git usage in linux

Source: Internet
Author: User

Git usage in linux
1. Common Operation 1: clone a remote warehouse, for example, clone test project branch v1.0

Git-c diff. mnemonicprefix = false-c core. quotepath = false clone -- branch v1.0 https://git.oschina.net/test.git/Users/test
After this part is executed, you will be prompted to enter account and password 2 of the repository and add local modifications.
Git add file names (multiple file names are separated by spaces)
3. Push all changes
Git commit-a-m' this is the comment'
-A indicates all,-m code message comment 4, pull remote update
Git pull
Here you will be prompted to enter account password 2, common error 1, the following error occurs when git pull: error: Your local changes to the following files wocould be overwritten by merge: this is a version conflict between the local and remote repositories. In this case, we first hide the local modifications, pull the remote updates, restore the local modifications, and then submit:
Git stashgit pullgit stash popgit commit-a-m' comment'
2. the following error occurs when git pull is not possible because you have unmerged files. in fact, it is a continuation of Error 1. If you forget to execute git commit-a-m, you can directly execute git pull again:
Git commit-a-m' comment'
If you want to use a file in the code library to completely overwrite the local working version, the method is as follows:
Git reset -- hardgit pull
The above methods must be executed in the git project directory.

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.