Thread (5 messages) flat view 5 messages, 4 authors, 2016-06-15

Create a new commit from patches without using any worktree?

From: Klas Lindberg <hidden>
Date: 2016-06-15 22:49:54

Hello

Is there any way to record a new commit based on contents in a patch
without going through a worktree? Of course the operation would have
to fail if the patch does not apply cleanly. The problem is I find
myself doing things like this:

put away current work on some branch A
checkout some branch B that is only used for patching
run git patch --check to see if patches apply cleanly. *reject* if
not. apply otherwise.
return to branch A.

I.e. the checkout of B is redundant because I'm anyway not going to
try to resolve any conflicts.

I know I can do something similar to what I need with "git-fetch
src:dst", except it's rather awkward if what you have is patches. I
suspect there must be some way to mimic that fetch behaviour manually,
and in a way that lets me choose exactly what to apply?

BR / Klas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help