I wonder if there is the way to copy one commit to another branch without checking out that branch.
For example, I have two branches: master and p
Crazy idea (based on mnaoumov's comment) if you really want to avoid touching the checked out files (say you don't want to disturb your build system) … that's what I want anyway.
git fetch clone && git branch mybranch clone/mybranch -fThis would be a thing to automate. If you have filesystem snapshots, cloning the whole repo is cheap – perhaps not so crazy after all…