# Add git submodule (bad rendering site)

**URL:** <https://discourse.gohugo.io/t/add-git-submodule-bad-rendering-site/21403>\
**Category:** tips & tricks\
**Created:** [October 23, 2019, 2:39pm UTC](https://discourse.gohugo.io/t/add-git-submodule-bad-rendering-site/21403 "2019-10-23T14:39:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bastianich](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bastianich/32/9809_2.png) [@bastianich](https://discourse.gohugo.io/u/bastianich)\
**Post date:** [October 23, 2019, 2:39pm UTC](https://discourse.gohugo.io/t/add-git-submodule-bad-rendering-site/21403/1 "2019-10-23T14:39:24Z")

</div>

After having followed step by step the construction of my site with the instructions on the site of hugo, at the entry “add submodule” at the first command it comes out like this

> > $ git submodule add -b master [git@github.com](mailto:git@github.com):saso94/saso94.github.io.git public && git commit -m “added submodule”  
> > Cloning into ‘C:/Users/trunf/Siti/SebastianoTT/public’…  
> > warning: You appear to have cloned an empty repository.  
> > fatal: ‘origin/master’ is not a commit and a branch ‘master’ cannot be created from it  
> > Unable to checkout submodule ‘public’

later, after repeating the command:

> $ git submodule add -b master [git@github.com](mailto:git@github.com):saso94/saso94.github.io.git public && git commit -m “added submodule”  
> ‘public’ does not have a commit checked out

the public folder was created, but the .gitmodules file was not added. in my case, after completing the procedure, before trying to access the site, I repeated the command

> $ git submodule add -b master [git@github.com](mailto:git@github.com):saso94/saso94.github.io.git public && git commit -m “added submodule”

and this is the output:

> Adding existing repo at ‘public’ to the index  
> warning: LF will be replaced by CRLF in .gitmodules.  
> The file will have its original line endings in your working directory  
> [master 7388896] added submodule  
> 2 files changed, 5 insertions(+)  
> create mode 100644 .gitmodules  
> create mode 160000 public

this add the file .gitmodules on the folder. now run the deploy file to update:

> $ ./deploy.sh “commit here”

> $ git push

this is the output of “git push”

> Enumerating objects: 4, done.  
> Counting objects: 100% (4/4), done.  
> Delta compression using up to 4 threads  
> Compressing objects: 100% (3/3), done.  
> Writing objects: 100% (3/3), 436 bytes | 145.00 KiB/s, done.  
> Total 3 (delta 0), reused 0 (delta 0)  
> To [GitHub - saso94/SebastianoTT](https://github.com/saso94/SebastianoTT.git)  
> d120436…7388896 master → master

now, running the site and the problem of bad rendering has been solved.

however, I have to thank the hugo forum for helping me solve many small problems.
