Fork me on GitHub
Drew Verlee20:10:22

Will magit allow you to assign commit pieces (hunks, buffer, whatever) to a branch that your not currently on? I have been watching someone do this in intelliji and it seems very useful for getting small pieces of work done.


Curious. I usually stash changes and change to or create a new branch. There is also (magit-branch-spinoff) which will create a new branch from the unique community of the local current branch (resetting the current branch to be the same as the shared/upstream branch)


I haven't noticed a way to specify a different branch when creating a new commit. I didn't find anything in a quick search, so would be curious if there is a way. Not sure how I would do this using git commands directly


I can't even find an example of how to do a new commit to another branch with intellij. If it's an existing commit on a branch, then it can also be cherry picked (which seems very simple on magit). Otherwise, I am unsure how to avoid staging and changing to another branch (unless it's a new branch where there aren't any constraints to changing a branch)

Drew Verlee02:10:30

Thanks for the reply. In intelliji i believe he was using a "change log" feature but then somehow that got tied into git. Then maybe it was cherry picking? I'll ask him to explain more next time.

👍 1

I wonder if this could also be done with commit hooks, maybe a post-commit hook :woman-shrugging: