emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding a recent commit in emacs-25 branch [ed19f2]


From: Ingo Lohmar
Subject: Re: Understanding a recent commit in emacs-25 branch [ed19f2]
Date: Sun, 03 Apr 2016 14:30:27 +0200
User-agent: Notmuch/0.20.2+113~g6332e6e (http://notmuchmail.org) Emacs/25.0.90.1 (x86_64-pc-linux-gnu)

Hi Alan,

On Sun, Apr 03 2016 12:14 (+0000), Alan Mackenzie wrote:

> Is there a way of asking "if I attempt git merge, will there be any
> conflicts?"?  It would be nice to find this out before one's working
> directory gets lots of uncommitted changes.

Just do the merge, and if you get conflicts that you do not want to
resolve, 'git merge --abort'.

Single caveat: Do NOT start a merge when you have uncommited changes.
If you want, do 'git stash' first to recover them later.

>
> Is there a way of recovering after doing git pull, when git has already
> written all the pulled changes to the working directory?  Is there some
> way of saying git undo-partial-pull, leaving the working directory as it
> was before the pull, and cancelling the merge which git has started?

See above.

> Sorry, I wasn't very clear.  What I meant was, is there a way of
> finishing the merge locally, then pushing real changes without the
> confusing "pseudo-merge" escaping upstream with them?
>
> When I did git pull, there were, let's say, 20 commits.  19 of these
> could have been moved directly into my local repository; only one had a
> conflict.  It would be nice to be able to fix the local repo, so that
> the "pseudo-merge" of these 19 blameless commits remains a purely local
> affair, and doesn't get pushed upstream.

It seems you are confused about some concepts.  The 'fetch' part of
'pull' has already dragged *all* commits into your local repository.
Now the question is about how to merge the branches (say 'master' and
'origin/master').  Here I can no longer follow your explanation.  I have
a feeling you actually want to avoid the merge commit as far as
possible.

In this case, you have to learn about rebase, as in 'git rebase
origin/master'.  This replays your commits (which should be only local)
on top of origin/master.  You will have to fix any conflict in your
commits, and you will end up with a linear history with your commits on
top of those already on origin/master.

Abort a rebase-gone-bad by 'git rebase --abort'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]