My notepad for [git-subtree] patterns for drupal sysop. [git-subtree]: https://github.com/apenwarr/git-subtree
Links:
- [git-subtree] repo by apenwarr
- manpage
- Examples:
- Having Fun With Git Subtree | h2ik has some nice examples
- Using Git subtrees for repository separation – Making Software
- Deploying a Git repository to a remote server | Wildly Inaccurate
- A few git tips you didn't know about
- hub · the command-line wrapper for git
- Patches to all components are tracked in the repository
- Patches can be re-applied after updates
- On updates patches should be rebased to easily re-upstream them
- Rebasing subtrees?
- Checkout a tag and have detached head?
- Slim subtree with only relevant commits to reduce repo weight? This will give for every use case a different solution.
- Can we drush-download from git directly into a subtree? Maybe with a suitable git pull versiontag:foo-upstream?
- Can we drush-download from git a single commit?
- See
git fetch --depth 1
,git checkout --orphan new-branch
,git checkout tree-ish -- .
- See git - Why can't I push from a shallow clone? - Stack Overflow
- (+) Has more drive, better toolbase and less clutter
- (+) Everything in repo, so does not rely on network connection
- (-) Not supported yet by drush and git_deploy.module
- (-) Large repository weight
- Subtree add foo-patched (checked out)
- Add branch foo-upstream = foo-patched
- (none of tha foo patches has a origin yet)
- In workspace fork
- checkout foo-upstream
- dl foo & commit
- checkout foo-patched
- rebase
- Add foo fork repo branch mysite-patches as remote of foo-patched
- push
- cherry-pick them
- How to rebase after git-subtree add? - Stack Overflow - one answer suggests:
git rebase --preserve-merges --preserve-committer --onto new_place start end
, also see