This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, make repoA contain only the files from the subdirectory you care about. To do this, we're going to first create a new working branch, and then use the filter-branch function of git. | |
cd ~/repoA | |
git branch -b informative_branch_name | |
git filter-branch --subdirectory-filter branch/you/want/with/trailing/slash/ -- --all | |
If you ls, you'll see that the repo contains only the files from the desired subdirectory. It would be a poor decision to push at this time. | |
Next, visit repoB, and add repoA as a remote. After that, check out the branch you just created (informative_branch_name) |