Let's say there are two branches: master
and feature-one
.
There are some files that you want in the master
branch from the feature-one
branch but not all the files.
Let's say those files are:
app/Models/User.php
app/Controllers/UsersController.php
You can accomplish that by doing the following:
- Checkout to the branch where you want to pull the changes. In our case, it's
master
branch.
git checkout master
- Checkout to the branch from where you want those files with the path to the files. In our case, it's
feature-one
branch.
git checkout feature-one app/Models/User.php app/Controllers/UsersController.php
After executing this command, you will see those files in the master
branch.
💥 BOOM