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
master
p
That's not possible - simply imagine what would happen if there was a conflict that couldn't be resolved automatically. For the same reason you also can't update branches that are not currently checked-out (even if a fast-forward was possible).