In my project folder I have 2 folders client and server, I only want get the changes in my server folder from master to prod branch
git checkout prod
- Go to the branch with the oldest changesgit merge --no-commit --no-ff master
- Merge with the branch with the latest changes. Read Moregit reset -- client*
- Unstage any changes from client folder, I only want to server folder. Read Moregit checkout -- client*
- Remove any changes from client folder, I only want to server folder.git clean -n
- View all unstaged files. Read Moregit clean -fd
- Remove all unstaged folder, if you dont want to remove all then you should add those withgit add <path>
and then run this command. Read More- Check if you have the required changes in the prod branch
git add . && git commit -m "Merge master with prod"
- Stage and commit your changes in the prod branch
The inspiration for this task came from an issue I had and this article helped think in the right direction
Thank you :)