Git common operations and problem solving

Source: Internet
Author: User
Tags using git

Record your own use of git as a common error in the project management process and how to handle it

1.git Pull problem occurred

Git pull has many problems with remote branch files and local conflicts

Error Hint: Error:your local changes to ' C/ENVIRON.C ' would is overwritten by merge. Aborting.please, commit your changes or stash them before you can merge.

Translation: This means that there is a conflict between the updated content and the locally modified content, either by committing your changes or by temporarily storing the local changes first.

Treatment: 1. Save the local file $ git stash 2. Follow the new $ git pull 3. Restore saved content $ git stash pop [email protected]{0} return hint auto-merging c/environ.c CONFLICT (content): Merge CONFLICT in c/environ.c 4. Resolving conflicts, opening conflicting files where updated upst The content between Ream and ===== is the content of pull down, and the content between = = and stashed changes is locally modified. In this case, Git does not know what line of content is needed, so you have to decide what you want. After the resolution is completed, it can be submitted normally. If you have pulled down from the server and have merged with the local code and want to recall, you can use the git log command to view your commit log, using git reset--hard <commitID> for version fallback2.git push issue occursThere are 1 problems with git push uploads. The local file does not commit 2.commit after the push commit fails 1. The local file does not have a commit (this is rare) No code found ... Don't put it on. I believe that all the students can read. Local commit is OK.2.commit After the push submission failed, this is the point. Workaround: Back up the online files branch. Then the local file push-f just fine. This method is forced to update the remote branch. So it's a good idea to back up remote files

Git common operations and problem solving

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.