On 15 January 2016, Bram Moolenaar <[email protected]> wrote:
> 
> I think most users will be in this situation:
> 
> - Initially check out Vim from github:
> 
>       git clone https://github.com/vim/vim.git
> 
> - Change a makefile to set some options, or change bigvim.bat to match
>   your Python version, etc.
> 
> - Build Vim.
> 
> So far so good.  Now the Vim version on Github gets patches, the user
> will want to simply sync to the latest version and keep his local
> changes (assuming there are no merge conflicts).  Now what is the git
> command for that?
> 
> A simple "git pull" results in the error "Your local changes to the
> following files would be overwritten".
> "git merge" does the same thing, so it doesn't actually merge.
> 
> Git is difficult...  Searches show me all kinds of different options
> with branches and complex arguments.  There must be a simple way...

    The trick is to use "--set-upstream-to".  Something like this:

        git clone https://github.com/vim/vim.git
        cd vim
        git co -b local
        git br -u origin/master

    This creates a branch named "local", switches to it, and sets it up
so that when you run "git pull" it merges changes from GitHub.  After
that you can just patch and commit your changes to this branch:

        ... edit ...
        git ci -am 'Some work done.'
        ... edit ...
        git ci -am 'Some more work done.'

    "git pull" will then merge changes to upstream master to your
branch, keeping your changes:

        git pull

    Of course, you'll need to resolve conflicts if any.

    /lcd

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui