I have branch master in GIT and there are a few files.
I want to add only one file from that branch to another, how to do that?
Can not find any info among the internet.
CodePudding user response:
Try with:
git checkout <file-destination-branch>
git checkout master -- <file-to-get-from-master-branch>
git add <file-to-get-from-master>
git commit -m "Got file from master branch"
CodePudding user response:
You can use the git checkout
command.
Step 1: go to the branch containing the file ($ git checkout <branch containing the file>
)
Step 2: run $ git checkout <branch to move the file to> <file>
For more info, run $ git -h checkout