Update the local git repository to the latest remote version.

Source: Internet
Author: User
========================================================== =============================== Original blog, reprinted please declare the source of Electronic coffee (original id blue rock) ========================================================== ================================

From: http://www.freeminded.org/index.php/2011/04/updating-local-git-repository-to-most-recent-version/

I use git to manage some of my software. This idea is simple. After a developer updates it, I only need to update the latest head from the local repository to the remote branch, in this way, I have the latest materials locally.

How can this problem be solved?

$ Git pull

Execute the above command in the root directory of your project (. Git directory) to achieve this effect. (To See. Git, You need to execute "ls-lah" to display hidden files ).

You may get an error:

5764cf9 .. 5d8cc2a master-> origin/masterupdating 5764cf9 .. 5d8cc2aerror: Your local changes '. oppbuildspec 'wocould be overwritten by merge. aborting. please, commit your changes or stash them before you can merge.

This error can be solved in a simple way:

$ Git stash save "updating to head from Repo"

Then you can continue to execute your pull command.

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.