Sai Kiran
Sai Kiran

Reputation: 177

Git not pushing all files

I have a www folder in which I have all my project files within their respective folder. I update those individual projects in git regularly.

Recently I tried pushing the whole www folder in a complete different repository but it ignored the Projects which were already pushed into their respective repo.

enter image description here

Here I have pset7 folder as a complete different repo, But when I try to push the parent (ie www) its ignoring all the files in pset7 and showing as empty directory on GitHub.

Upvotes: 2

Views: 1338

Answers (1)

Jake Henningsgaard
Jake Henningsgaard

Reputation: 702

When you push the parent repo, it will not push the submodules contained within it. You can use the command git push --recurse-submodules.

Additionally, you can use the options check and on-demand:

  • If check is used, it will be checked that all submodule commits that changed in the revisions to be pushed are available on a remote. Otherwise the push will be aborted and exit with non-zero status. If on-demand is used, all submodules that changed in the revisions to be pushed will be pushed.

  • If on-demand was not able to push all necessary revisions it will
    also be aborted and exit with non-zero status.

...So use the command git push --recurse-submodules=on-demand within your parent directory and you will also push all the submodules (i.e. repos) one level down from the parent repo.

Upvotes: 2

Related Questions