Follow

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?

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!

oxo.codeberg.page/

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.