Git le目录?它会让我在我的repo中留下子树吗?@nr5-你可能只需要对每个你想要合并历史的目录重复这个过程 branch-a - content-1 - dir-1 - content-2 branch-b - content-1 - di

Git le目录?它会让我在我的repo中留下子树吗?@nr5-你可能只需要对每个你想要合并历史的目录重复这个过程 branch-a - content-1 - dir-1 - content-2 branch-b - content-1 - di,git,Git,le目录?它会让我在我的repo中留下子树吗?@nr5-你可能只需要对每个你想要合并历史的目录重复这个过程 branch-a - content-1 - dir-1 - content-2 branch-b - content-1 - dir-1 - `content-2 git remote add -f infochimps git://github.com/infochimps/cluster_chef.git git merge --allow-unrelated


le目录?它会让我在我的repo中留下子树吗?@nr5-你可能只需要对每个你想要合并历史的目录重复这个过程
branch-a
 - content-1
 - dir-1
   - content-2
branch-b
 - content-1
 - dir-1
   - `content-2
git remote add -f infochimps git://github.com/infochimps/cluster_chef.git git merge --allow-unrelated-histories -s ours --no-commit infochimps/master git read-tree --prefix=cassandra/ -u infochimps/master:cookbooks/cassandra
fatal: Not a valid object name
git commit -m 'merging in infochimps cassandra'
git rm -r cassandra
git read-tree --prefix=cassandra/ -u infochimps/master:cookbooks/cassandra
git checkout source-branch
git checkout target-branch <directories-or-files-you-do-**NOT**-want> 
git commit
git checkout target-branch
git merge source-branch
git checkout branch-a
git diff branch-b dir-1 > a.diff
patch -R -p1 < a.diff
git checkout destination
git checkout source newFeature/
git commit -am "Merged the new feature from source to destination branch."
git pull --rebase
git push
git log ^<commit-a> <commit-b> --pretty=format:"%h" --reverse -- <subdir>
git cherry-pick $(git log ^<commit-a> <commit-b> --pretty=format:"%h" --reverse -- <subdir>)
# Make sure you are in the branch with the changes you want
git checkout branch-a

# Split the desired folder into its own temporary branch
# This replays all commits, so it could take a while
git subtree split -P dir-1 -b temp-branch

# Enter the branch where you want to merge the desired changes into
git checkout branch-b

# Merge the changes from the temporary branch
git subtree merge -P dir-1 temp-branch

# Handle any conflicts
git mergetool

# Commit
git commit -am "Merged dir-1 changes from branch-a"

# Delete temp-branch
git branch -d temp-branch