git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes
@ 2022-02-17 20:50 Yuri
  2022-02-22 16:37 ` Phillip Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Yuri @ 2022-02-17 20:50 UTC (permalink / raw)
  To: Git Mailing List

I have a file "x" that has one local change and some incoming pulled 
changes.

Pulled changes are contextually very far away, so it should be possible 
to merge them without user interaction.

But git still complains:

$ git pull
Updating 91bfe02..522ccf2
error: Your local changes to the following files would be overwritten by 
merge:
     x


Yuri



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes
  2022-02-17 20:50 When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes Yuri
@ 2022-02-22 16:37 ` Phillip Wood
  2022-02-23 21:23   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Wood @ 2022-02-22 16:37 UTC (permalink / raw)
  To: Yuri, Git Mailing List

Hi Yuri

On 17/02/2022 20:50, Yuri wrote:
> I have a file "x" that has one local change and some incoming pulled 
> changes.
> 
> Pulled changes are contextually very far away, so it should be possible 
> to merge them without user interaction.
> 
> But git still complains:
> 
> $ git pull
> Updating 91bfe02..522ccf2
> error: Your local changes to the following files would be overwritten by 
> merge:
>      x

pull only uses rebase.autoStash if you ask it to rebase, if it is trying 
to merge then you need to pass --autostash on the command line or set 
merge.autoStash (assuming you want merge to always use --autostash).

Best Wishes

Phillip

> 
> Yuri
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes
  2022-02-22 16:37 ` Phillip Wood
@ 2022-02-23 21:23   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2022-02-23 21:23 UTC (permalink / raw)
  To: Phillip Wood; +Cc: Yuri, Git Mailing List

Phillip Wood <phillip.wood123@gmail.com> writes:

> On 17/02/2022 20:50, Yuri wrote:
>> I have a file "x" that has one local change and some incoming pulled
>> changes.
>> Pulled changes are contextually very far away, so it should be
>> possible to merge them without user interaction.
>> But git still complains:
>> $ git pull
>> Updating 91bfe02..522ccf2
>> error: Your local changes to the following files would be
>> overwritten by merge:
>>      x
>
> pull only uses rebase.autoStash if you ask it to rebase, if it is
> trying to merge then you need to pass --autostash on the command line
> or set merge.autoStash (assuming you want merge to always use
> --autostash).

I wonder if it would make a good #leftoverbit starter project to
introduce pull.autoStash so that those who want autostash only when
running "git pull" (but not "git merge" or "git rebase") can set it,
ignoring the settings of merge/rebase.autoStash variables.

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-23 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 20:50 When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes Yuri
2022-02-22 16:37 ` Phillip Wood
2022-02-23 21:23   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).