threads / discuss / 38671

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

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

## tl;dr

One message between Mar 1, 2015 and Mar 1, 2015.

replies: 0people: 1as markdown or json

William Di Luigi· Mar 1, 2015, 00:43 UTC · lore

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

← back to recent threads