First I wrongly copied another repo source straight to one bigger project, in a subdir. The original repo and subdir were changed both ever since that time. Now I have knowledge of git-subtree, I want to make the subdir as a real subtree so that I can easily sync the change from original repo.
I tried 'git-subtree split', then pull latest source from original repo, it just worked. However, I don't want the whole history, but '--squash' didn't work for 'split', here's my commands
git subtree split -P xxx-dir --onto==1940032
git remote add xxx https://github.com....
git fetch xxx
git subtree pull -P xxx-dir xxx master
# the pull worked, but whole history of xxx was imported too. '--squash' didn't work for above 'pull'
git subtree merge -P xxx-dir xxx/master --squash
# Can't squash-merge: 'xxx-dir' was never added.
Looked like squash only works for subtree added but not split.
Any idea? Thanks.