Menu icon Foundation
Nested Git Repositories

My whole website is contained in a Git repository. When I run foundation new it creates a new git repository inside my existing one which causes problems. What is the best way round this? In Foundation 4 I was using the Standalone version, this also worked better with Phpstorm as I could use the file watchers to compile my SCSS files.

gitSass

My whole website is contained in a Git repository. When I run foundation new it creates a new git repository inside my existing one which causes problems. What is the best way round this? In Foundation 4 I was using the Standalone version, this also worked better with Phpstorm as I could use the file watchers to compile my SCSS files.

Albert over 5 years ago

I have the same issue

The curious thing is, that i created a new foundation project 2 days ago (12/02/2013), and it didn't create a new git repository

Andrea DeMers over 5 years ago

I have the same issue.

Would deleting the Foundation 5 .git repo cause problems with updating Foundation, or other?

Thanks!

Andrea DeMers over 5 years ago

I found this Twitter conversation:

http://cl.ly/image/3k083M3j2P13

Also, It looks like Git Submodules may be a solution.

UPDATE:

Nevermind Git Submodules. I think the issues was that I was keeping the foundation5 source files AND my compiled CSS in the same directory, in my case "assets".

I created a new dir. called "foundation5" and installed foundation5 via compass "foundation new foundation5".

Then, I edited config.rb to compile app.scss to assets/css.

Also, I added the "foundation5" dir to my main project's .gitignore file.

Now, my foundation5 project files are separate from my compiled CSS and so far, I haven't had any issues.

Francesco Pensabene over 5 years ago

Andrea,

Your solution seems interesting, but how are you dealing withe the rest of the files, for example js files are you copying them?

the tweet you referenced was mine :-) but I'm still waiting for a definitive response: is te git repo indispensable to run udates using "foundation update" ?

Anyone?

Andrea DeMers over 5 years ago

Hi Francesco,

It's a small world! ;)

I agree. It would also like to know if the git repo is indispensable, and if so, why. :)

For now, I copied over app. js. However, I plan on using CodeKit to combine, minify and output all the js into my assets/js folder.

Karl Johan Kleist over 5 years ago

I've been wondering about this ".git" directory as well. See my comment in http://foundation.zurb.com/forum/posts/857-upgrading-to-f5sass-without-compass--ruby--#

Carlo Laitano over 5 years ago

I haven't found a solid response from the Zurb team on this subject. Would be nice to hear from them as I use Foundation for many projects. Would like to have a customized base setup but this git submodule issue is getting in the way.

Lee over 5 years ago

I've been asking the same questions, I'm building a Sinatra app but it could just as well be a static html site. I would still use git, I had a similar idea of creating a foundation5 folder but I want to have all the javascript in a root level folder without having to manually copy them every time I update etc.

The css version has a folder structure that makes more sense than the SASS version, but I like the idea of using the cli it just doesn't seem to be well trout out.

http://foundation.zurb.com/forum/posts/1203-issues-creating-a-foundation-5-project

Paul Ellis over 5 years ago

Still no official response but it good to see that I am not alone.

The workflow that I have going is that I have a 'base' foundation folder outside of my web projects repository. I keep this updated with the 'foundation update' command. I then copy the relevant files to my real projects with a script.

Francesco Pensabene about 5 years ago

Just some news...

5.0.3 is out now so i did a Bower update to one of my projects and then did a test on a copy of the project where i deleted the git repo. Well... Using bower update to that copy of the project just did the update! So in my opinion you can delete the git repo and still get the updates from bower and so use the project inside another repo without having to deal with submodules...

Any other news?

bye
Francesco

Miguel Franco about 5 years ago

I have same issue in a project I am working on.

No fix yet just the work-around suggested by Andrea, what I dont like is that I have to copy the app.scss at the end of the day to the "foundation5 " folder to make it available in the project repository.

I tried using compass and libsass to create a fundation project but both had the .git folder, and I also tried removing this folder but the git of my main project doesnt even recognize the foundation project anymore.
when I run "git status" on main project git, and I am sure I have some changes on foundation project, it still gives me a message of "Nothing to commit".

It would be nice to have an answer or a way to be able to use a project using git with a foundation project inside in it.

Miguel Franco about 5 years ago

Update:

Actually Francesco suggestion works fine, using bower to update Foundation and removing the .git folder, the only thing that I found is that one most delete the .git folder first thing after creating a foundation project, other wise for some reason the folder wont get recognized by the main project git.

Uzi Ashkenazi over 4 years ago

In case you realize this after some work is done... This worked for me:

Delete the .git folder.
Remove the entire project from the repo.
A and commit the change.

git add . -A
git commit -m "removed nested git folder and project to resolve nested repo issue"

Add the project back to the main repo.
Add and commit the change.

git add .
git commit -m "Added project back to main repo"

You may lose some history on the project file but at least any new changes will be properly tracked.