I have been working for sometime on a development branch. During this time I have changed and committed many files. The changes to one file, a shared library file, now need to be merged onto the master branch while leaving other files unchanged. How can this, merging one or more specific files from one branch to another, be achieved?
If there is a specific commit or set of commits that contain the changes you need (and none of the changes you don't), you can "cherry pick" the commits into another branch.
Otherwise, you'll need to copy the changes by hand. Merges effect the entire working copy.
You could do a merge and amend the merge commit to remove all the changes for the other files, but Git would see that as a commit that reverses those changes, and you'd have big problems if you decide to really merge those changes later on.
EDIT: Git does allow for "submodules" and "subtrees", which might give you the workflow you need, but I've never used them, and it doesn't sound like your library file is set up that way currently.
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot