Merge folder from one branch into another with git
I’m working with two branches in a git repository.
- git reset --hard to commit does not work - Tip is HEAD is behind
- Log Graph in TortoiseGit not showing branch/merge?
- Recommendations for storing project documents for shared access?
- How can I synchronize closed and open sourced versions of the same tool using Mercurial?
- Best branching strategy when doing continuous integration?
- How can I checkout a branch while ensuring that none of my current branch's changes are carried over?
I have a folder in
src/ that I need to merge into
I’ve tried to use
git cherry-pick --strategy=recurisve --strategy-option=theirs <commit> method by first creating a shell script to add a new line to all the files in the directory to trigger a change with git.
The script was as follows:
#/bin/sh SEARCH_FOLDER="src/*" for f in $(find $SEARCH_FOLDER); do echo "" >> $f; done;
What I did not realize is that
git cherry-pick is only going to take the recognized changes vis-a-vis the aforementioned newlines.
Aside from just copying the folder over into a branch of
rc and then creating a commit and merging, what are my options to push my changes that I’ve been working on in
dev for two weeks into the
I understand that the way I have been developing and using git is probably inappropriate and not intended use.
Ideally, I’d like to create a patch file using the diff on the two branches subfolders
src/ and apply it. Though, I’m not sure how to execute this approach.
One Solution collect form web for “Merge folder from one branch into another with git”
You should be able to grab the whole
src folder from
dev like this:
While on your
git checkout dev -- src/