I have a situation where I committed to a branch B1. In the commit I have several files. Now I want those files to be copied to a Branch B2.
Actually I am using the following command for each file in the commit on my current branch B2:
$ git checkout B1 path/to/file1
$ git checkout B1 path/to/file2
......
$ git checkout B1 path/to/fileN
I guess that there should be a syntax that will allow me to directly checkout the specific commit from branch B1 to branch B2. I tried several solutions but they are rewriting the whole branch which I do not want, nor history of the all files. I only want the state of the file in the particular commit. Overwriting is not a problem.
How to achieve this ?