git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Feature request] Commit flag to "ignore" conflicting/unmerged changes

From
WLWilliam Di Luigi <williamdiluigi@gmail.com>
Date
Mar 1, 2015, 00:43 UTC
Message-ID
<CAJNpUg5RdXBxSGiZoSVHNZK84VbztTARqRXy+v0y0_bSQZ4c4A@mail.gmail.com>

Hi, the scenario is as follows: I'm working on a repo where only "rebase" is used and never "merge" (which can arguably be a bad thing). Anyway, I worked on a separate branch for some time and now I need to integrate all the changes introduces by "master" (and prepare some "fixup" commits that will be used when the branch will be finally rebased).

So I call `git merge --squash --no-commit master` and some conflicts come out. Suppose that I now have 100 files automatically merged and staged by git, and 10 files which are conflicting ("both modified") and I'll need to fix by hand.

The point is: I would like to commit *all* the changes that git successfully merged (*including* partial changes inside conflicting files). After that, I will start to work on the conflicts (which will be resolved with several "fixup" commits).

For the moment, the only (quite tedious) way I've found to do it is this:
1. `git reset HEAD` for each of the 10 conflicting files
2. `git add -p` and select only the non-conflicted hunks
3. `git commit` let's call this commit "temp"

Then, I can finally work with *just* the conflicts. When I will rebase on master, I will simply discard the "temp" commit and I will apply every fixup that piled up.

The feature I'm requesting is something like a flag that allows `git commit` to work anyway by "ignoring" unmerged hunks (which can then be downgraded to unstaged changes).

What do you think?

Regards, William

Message 1 of 1 in “[Feature request] Commit flag to "ignore" conflicting/unmerged changes”
  1. William Di LuigiMar 1, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.