Re: [git-users] Changes made by "git commit --amend" against merged commit were lost when executing squash rebase

2019-10-20 Thread Benjamin
Thanks for the info.  Neither "--rebase-merges" nor "--preserve-merges" can 
prevent the changes made by "git commit --amend" against merge commit from 
being lost. The only solution to recover the lost code is to make use of 
"git reflog". 

在 2019年10月18日星期五 UTC+8下午5:36:08,Mikko Rantalainen写道:
>
> On Fri, 18 Oct 2019 at 11:59, Benjamin > 
> wrote:
>
>> This could be an issue of git. The exact steps to reproduce this issue 
>> are as below,
>>
>> $git merge master
>> ...
>>$git rebase -i e705c6a dev1  # e705c6a is the ancestor commit of 
>> branch dev1
>>In the interactive rebase page, Keep using "pick" for the first 
>> commit, and use "s" for all other commits. 
>> 5. You will find that the changes made in step 3 are lost.
>>
>
> I'd suggest doing `git help rebase` and reading about `--preserve-merges` 
> and section "BUGS". Short quotation:
>
>-p, --preserve-merges
>>Recreate merge commits instead of flattening the history by
>>replaying commits a merge commit introduces. Merge conflict
>>resolutions or manual amendments to merge commits are not
>>preserved.
>>This uses the --interactive machinery internally, but 
>> combining it
>>with the --interactive option explicitly is generally not a 
>> good
>>idea unless you know what you are doing (see BUGS below).
>
>
> and
>  
>
>> BUGS
>>The todo list presented by --preserve-merges --interactive does not
>>represent the topology of the revision graph. Editing commits and
>>rewording their commit messages should work fine, but attempts to
>>reorder commits tend to produce counterintuitive results.
>
>  
> In short, doing interactive rebase with merges is always a bit hard. 
> Trying to combine that with squash is asking for trouble.
>
> If you really want to do the merge and squash combined, I think you can 
> start with your current final code with "incorrect" history, do a `git 
> reset --soft $MERGESHA1` and then `git commit --amend`. If you already lost 
> the "final code", `git reflog` will be your friend.
>
> -- 
> Mikko
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/b303b88c-7022-4aeb-97b1-b5da55e96586%40googlegroups.com.


[git-users] Re: Getting git-bash to work in a Windows Terminal ?

2019-10-20 Thread Philip Oakley
Hi Christopher,

I (personally) am also trying to get my head around the terminal 
awkwardness. Have a look at 

https://groups.google.com/forum/#!msg/git-for-windows/o4vIpvIEWhE/pbp9-dHqBgAJ

https://github.com/git-for-windows/git/issues/1674

https://github.com/git-for-windows/git/pull/2357?email_source=notifications&email_token=AAG7HJ555OM6DJGKTQ54OVLQPITQ7A5CNFSM4JBMC7D2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBWCQ4Q#issuecomment-543959154

(some cross linkage and links to other GH Issues)

IIUC the git-bash is compiled as a resource from the build-extra makefile 
and links into the git.cmd (I think). plus, it updates the path so that the 
current git can be found. Dscho is the expert on this. 

I'm trying to document some of the intricacies that folk may need to know - 
so my ignorance is both a help and a hindrance :wink:

Philip

On Sunday, October 20, 2019 at 2:39:03 PM UTC+1, CrestChristopher wrote:
>
> Hi, I’m having an issue with git-bash; and I hope someone can help.
>
> When I’m in command (DOS) in Windows, I can change between DOS and 
> Powershell by simply typing in either cmd or powershell and my shell 
> changes. Since I’m using another terminal, rather then the default Windows 
> command shell this terminal has an option which I can include paths for 
> whatever shell I choose, unfortunately when I include the path to git-bash 
> and type git-bash in the terminal, rather then it changing to *git-bash*, 
> I get an error; it is unrecognized ?
>
> How can I make this work, must I give the path to a .bashrc file or 
> .bash_profile file ?
> ​
>
> Christopher
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/2b05d706-0cab-4da7-88d2-458feaebe922%40googlegroups.com.


[git-users] Getting git-bash to work in a Windows Terminal ?

2019-10-20 Thread CrestChristopher

Hi, I’m having an issue with git-bash; and I hope someone can help.

When I’m in command (DOS) in Windows, I can change between DOS and 
Powershell by simply typing in either |cmd| or |powershell| and my shell 
changes. Since I’m using another terminal, rather then the default 
Windows command shell this terminal has an option which I can include 
paths for whatever shell I choose, unfortunately when I include the path 
to |git-bash| and type |git-bash| in the terminal, rather then it 
changing to /git-bash/, I get an error; it is unrecognized ?


How can I make this work, must I give the path to a |.bashrc| file or 
|.bash_profile| file ?


​

Christopher

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/4f305f39-5cdb-ecc0-e766-499a951069e4%40gmail.com.