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.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
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