What about conflicts with local files when using git pull files?

Source: Internet
Author: User
Tags using git

The specific method is as follows

Git pull Origin branch // error occurred git stash   // Restore git stash Clear

Developers often encounter this situation: It took a few days to do a new function, has changed almost more than 10 files, suddenly a bug needs to be resolved urgently, and then to a build test group. It's often time-consuming and error-prone to rely on manual backups before git comes out.

The git stash command in a nutshell is to help developers temporarily shelve changes that have been made, back to their pre-change state, perform other necessary actions (such as publishing, or fix a bug, or branch, and so on), and then reload the previously shelved changes. Pretty cool, huh?

First, use git add to add all the changes to staging area.

git Add.

Then use git stash to put these changes on hold.

Git stash

Here, the current work platform is back to the change. What to do, omit 10,000 words here.

Need to retrieve previous pending changes to continue with previous work?

Git stash apply   . 

You can also use git stash list to see all of the shelved versions (may have been shelved many times, it is better not to do so, easy to confuse)

In the case of a shelving stack, such as if you want to retrieve the 2nd in the stack, you can use git stash apply [email protected]{1}

If you want to retrieve the 1th one, you can use git stash pop

If you want to delete a stash,git stash drop <id>

Delete all stash,git stash clear

Turn:

http://my.oschina.net/u/554046/blog/308614

http://www.01happy.com/git-resolve-conflicts/

What about conflicts with local files when using git pull files?

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.