Packy
Packy

Reputation: 3573

Git not tracking a subdirectory

I am pretty new to Git and it seems I always have some issue. I created a repo for my WordPress project but it isn't tracking the "Themes" folder. I think the issue is in the themes folder I pull my starter template from another repo. I removed the Git tracking (since it was attached to another repo) from that folder but when I push to my remote for this project it looks like this with no tracking. Any ideas???

Git

Upvotes: 2

Views: 2944

Answers (1)

nwinkler
nwinkler

Reputation: 54457

It looks like the themes folder is a Git Submodule, which means that it points to a specific commit (as indicated by the commit hash) in a different repository. This is often done to avoid duplicating the whole folder across repositories.

In many cases it's perfectly fine to do this - I can see the benefit of doing this with shared themes, like in your case. The Git repo will take care of managing the dependency to the other repo, you generally don't have to do anything.

If you really want to convert the themes submodule into a real folder that you can track, you can take a look at this question, which has multiple possible ways of doing this.

Upvotes: 4

Related Questions