Tired of my struggle with git today...
I happen to have a nested git repository. Which is the public directory inside my Hugo framework. Git has a solution for that called: submodule.
But the assumption in the documentation seems to be that you add a submodule from a remote server and basically clone it. But I generate it locally.
So I have to remove public from the tracked files (git rm -r --cache) then cd into public, then git init, then git add and commit all stuff in public, then I can add the submodule from the projects root...
I think I am on the right track? Am I?
#linux #commandline #git #submodule
It turned out this morning that the solution is way easier than having to use a submodule.
I removed the remote from the main hugo git config file. Then went into the public directory and did a ```git init``` there (again). But now I did define upstream.
This way I can push from public after hugo has populated the files there, without pushing the entire hugo framework with it. This way it works!
https://oxo.codeberg.page/
#hugo #git