Git users: I am looking for a tool that may or may not exist; please share for reach! If it exists, please let me know!

I want a tool where, given the current repo state or the current repo state and a set of commits (source state), I can create a new history like so:

* Drag and drop files and parts of files from the source state into new commits
* Drag and drop files and parts from the source state into a new commits on different branches.

I often find myself touching a lot of areas when trying to figure out how to solve a problem. I'll also have a bunch of WIP commits that I may not want to push. I'll get to the end and I'll be like "this should be multiple commits" or "this should be multiple PRs" or "the history just needs to be cleaned up" It's not absurdly hard to move the parts around via command line but it's tedious, time-consuming and error prone.

I just want to a way to basically say "This end result is more or less what I want, now just let me easily drag the parts around to where I want them" so I have a clean set of commits and branches.

@wwahammy I don't have a tool recommendation, but maybe a process one? I tend to use `git cherry-pick` in situations like this to re-apply commits to new places.
@bradwilson I do too but it's still error prone
@wwahammy I haven’t used it extensively myself yet, but that sounds somewhat like what https://gitbutler.com/ proclaims to do.
GitButler

GitButler software development platform

GitButler

@philip based on its demos, I think so.

For whatever reason, it doesn't seem to function on my computer. I'm not a huge fan of them using a delayed open source license either.

@wwahammy @dexter

I'm not certain about the "drag and drop" aspects of things (that sounds more GUI than I do), but it sounds a bit like git-cherry-pick (to choose commits from another branch) or git-am (to apply unassociated patches if that's how your "set of commits" arrives), possibly using --no-commit to leave the state of the repo alone, allowing you to apply multiple changesets/patches and then use `git-add -p` (to add portions of files rather than entire files) or just `git-add` to selectively chose portions of those for the individual commits.

Once you have all the commits happening, you can `git-rebase -i` to do any additional WIP-collapsing or commit-reordering (beware that reordering commits can result in conflicts that need to be resolve) you want along the way for the clean commit-history before pushing it upstream.

I recommend doing all this against a test/junk branch that you have no qualms about and then once you're happy with that, merge it into your main branch (which should be a fast-forward merge)

@wwahammy Not sure if it can help but take a look on git worktree

https://git-scm.com/docs/git-worktree

Git - git-worktree Documentation

@wwahammy it's not 100% the workflow you're looking for. But I find it useful when I'm working on something and want to test another idea without messing up my current work. Another thing I use is when reviewing someone else's code without having to commit my current work

@wwahammy It sounds to me like most of what you want is a more usable UI for git add -p; am I off base?

To be clear, I'm not in any way claiming that the existing workflow for this is good, just checking whether that is the kind of activity you want better tool support for.

Hmmm, I guess I'd want a UI that lets me select a part of a change and say "move this to an earlier/later commit", either creating a new commit at a specified point in the history, or selecting an existing one. I think it ought to be able to help resolve some merge conflicts too, under the constraint that the later of the two commits involved in the move should end up with the same tree contents after the move is done.

@jamey @wwahammy knowing add -p and rebase is one of those interview questions I use to measure git and workflow comfort
@wwahammy Do you use Emacs/Magit by any chance? It doesn't do exactly what you are describing, but it's what I've found has the best UI to edit commits, split them, commit changes selectively, etc.
@wwahammy I'm not a git gui user but this sounds so cool if it did exist!