Replacing git-subrepo with josh-filter
To initialize (with single
to get a clean history in the current repository):
1➜ git remote add hzeon git@github.com:HaoZeke/eOn
2➜ git fetch hzeon doCIdimer
3 josh-filter ':prefix=subrepos/eOn' FETCH_HEAD --single
4 git merge --allow-unrelated FILTERED_HEAD
Changes can be made within the sub-repo.
1echo "blah" > subrepos/eOn/blah
2git add subrepos/eOn/blah
3git commit -m "blah"
When changes are to be pushed back upstream / to another branch..
1git fetch hzeon doCIdimer
2josh-filter ':/subrepos/eOn' HEAD --update FILTERED_HEAD
3git push hzeon FILTERED_HEAD:refs/heads/dotry
Which works since josh-filter
allows for inverse operations and generates
commits reproducibly. Personally I find this easier to grok than the many
thousands of bash
which makes up git-subrepo
but this is debatable.
Comments