i'm managing own personal small site via git, more learning experience real advantages in doing so. workflow generally:
- make changes on desktop
- test file:///path/to/folder in browser, , add/commit/change appropriate
- when i'm happy, push origin, i've set ec2 instance, post-commit hook updates working tree
i want use mathjax display maths equations on site, mathjax folder 128mb, while rest of project barely comprises 1mb altogether. moreover, mathjax/ contains many small files, , (since entered working tree) operations git add , git status running - assume because git having check every 1 of files individually status.
i'm tempted git reset --hard
commit before adding mathjax/, exclude mathjax folder git repo (.gitignore), , add webserver manually, on grounds won't changing mathjax regularly, , adding repo seems add considerable overhead otherwise speedy operations. again, means repo not self-contained entity, seems conceptually wrong - know how frustrated when download tasty-looking new script or service, , have hunt down fifteen dependencies before run.
obviously, no-one else going working on particular repo, i'd habits nonetheless. what's best practice in situation this? should large dependencies included in repo? if not, what's best way of referring them - readme.md?
quoting git book:
it happens while working on 1 project, need use project within it. perhaps it’s library third party developed or you’re developing separately , using in multiple parent projects. common issue arises in these scenarios: want able treat 2 projects separate yet still able use 1 within other.
you need use git feature called submodules. it's git repository inside git repository. see git book or man pages details.
other option git subtree (not confused subtree merging). it's available in git versions 1.7.11 , later. nice blog post describing use of subtree here: https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/
Comments
Post a Comment