Git Subtree: sdlc-aws-cdk-lib
This repository includes the sdlc-aws-cdk-lib project as a git subtree under modules/sdlc-aws-cdk-lib.
Initial Setup
Run these commands from the root of this repo to add the subtree.
- Add the remote (one-time):
git remote add sdlc-aws-cdk-lib [email protected]:akfdev-com/sdlc-aws-cdk-lib.git
git fetch sdlc-aws-cdk-lib
- Add the subtree (using the
mainbranch):
git subtree add --prefix=modules/sdlc-aws-cdk-lib sdlc-aws-cdk-lib main --squash
--prefixis the folder where the subtree will live.--squashkeeps a single merge commit instead of all upstream history.
Updating From Upstream
When there are new changes in sdlc-aws-cdk-lib:
git fetch sdlc-aws-cdk-lib
git subtree pull --prefix=modules/sdlc-aws-cdk-lib sdlc-aws-cdk-lib main --squash
You can also verify that the subtree folder is present and not accidentally removed with the helper script:
npm run checkSubtree
Pushing Changes Back Upstream
If you make changes inside modules/sdlc-aws-cdk-lib and want to push them back to the upstream repo:
git subtree push --prefix=modules/sdlc-aws-cdk-lib sdlc-aws-cdk-lib main
Notes
- Remote:
[email protected]:akfdev-com/sdlc-aws-cdk-lib.git - Branch:
main(change if the upstream default branch differs). - Make sure the
sdlc-aws-cdk-libremote is configured on every clone that needs to pull or push subtree changes.