I have a git project (with source files = markdown files published with hugo) with a submodule (linked to a "public/" folder, and containing only some generated files (that are then published to github pages through a dedicated github project)).
HOME :
.git/
.gitmodules
content/
public/ -> linked to a submodule (no .git folder)
Submodule has been added through git submodule add -b slides <URL> public
(per : https://gohugo.io/hosting-and-deployment/hosting-on-github/ )
Everything is working fine (i can commit and push source files and/or auto-generated files separately).
But i have a growing commit history for the content of the submodule folder (published in a dedicated project). Moreover this is 100% useless (being autogenerated all the time).
So is there a way to easily remove all these commits from the submodule, and only from it ?
The submodule is a local clone of the target repo.
Its git database is stored under .git/modules/<modulename>
(instead of a .git
directory under public/
).
So :
git subtree
for example)All in all, I'm not sure if 2. or 3. are worth the effort in your situation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.