Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why git commit --amend make confliction happened? that is quite strange

*   84b134d - (HEAD, origin/lab_master, lab_master) comment macro defination which is protent to be a fun
|\
| * 735d88f - add small script to ease ctag related option (13 minutes ago) 
* | 6623a94 - add small script to ease ctag related option (4 minutes ago) 
|/
* 0d0913a - add gitignore to ignore ctags file (57 minutes ago) 

735d88f is a --amend commit, but conflict happened at this moment, why?

i have only one pc, and i always edit files on it, also i have only one local repo, what's more this repo is only used by here, i think there is no possibility that conflict may happen?

but it happened, why?

like image 312
hugemeow Avatar asked Jan 30 '26 07:01

hugemeow


1 Answers

It is best to amend only commits you have not already pushed to your server. Once you push a commit, if you try to amend it and push it, it will result in a conflict because you have changed history (as recorded on the server).

like image 99
Mark Granoff Avatar answered Feb 01 '26 23:02

Mark Granoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!