Answer the question
In order to leave comments, you need to log in
How to move certain files from one branch to another branch?
There are two parallel development branches that work on shared files. But in one and the other branch, you need to make changes in these files. Accordingly, it is necessary to pull out only certain files from a certain commit of one branch and upload them to another branch.
How to do this with git?
Answer the question
In order to leave comments, you need to log in
No way, the atomic unit is the commit, they can be transferred, and the parts of the commit - if you please, by hand.
> There are two parallel development branches that work with shared files. But in one and the other branch, you need to make changes in these files.
> Accordingly, it is necessary to pull out only certain files from a certain commit of one branch and upload them to another branch.
I do not understand where the transition from the first to the second. Branches are there to make different changes in the same files. If the changes are the same, merge those commits made in branch A into branch B, or if merging is not possible, then cherry-pick specific commits. Why take anything out?
Copy from here:
How to move files from one branch to another?
Switch to the branch where you want to move the file, for example
git checkout master Pick up
the desired file from another branch
git checkout $branch_name --
$
paths_to_file
the branch in which you originally placed the files, they will remain, you need to delete them yourself if they are not needed there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question