I know about submodule, but have a weird edge case where I want to avoid keeping a separate directory for the external repository's code.
I have a LaTeX project for my graduate thesis: https://github.com/jklukas/gradthesis
Which uses a style file which I keep in a separate repository (for others to easily use): https://github.com/jklukas/uwthesis
I could include uwthesis as a submodule, but LaTeX only looks for style files in the main directory. There are hacky ways around this in LaTeX, like giving the explicit path when importing the style file, but that just seems ugly.
Currently, I'm just keeping a copy of uwthesis.sty
in the gradthesis
repo. Would it be possible to configure uwthesis
as a remote and be able to push changes there for just this one file?
You could add your submodule using the normal git submodule
mechanics:
git submodule add git://github.com/jklukas/uwthesis.git uwthesis
And then create a symlink from the top-level directory to the appropriate style file:
ln -s uwthesis/uwthesis.sty uwthesis.sty
If your problem is only
push changes there for just this one file
you can add all files, excluding one, to .gitignore
like this:
*
!path/to/explicit.file
and clear your local repo index:
git rm -r --cached .
Then add, commit and push whatever you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With