How do I create nested repositories in GitHub?

GitHub does not allow nested repositories (IIRC Git doesn’t allow this for bare repositories). However, you can use submodules to nest repositories on the “client side” in the working tree. You need to clone the parent directory. Then, add the sub-repository as a submodule: git submodule add https://github.com/username/sub_repo.git The sub_repo module will then be linked … Read more

Set Git submodule to shallow clone & sparse checkout?

With git1.8.4 (July 2013), in addition git shallow update for submodule (git submodule update –depth 1), you now can have a custom update: In addition to the choice from “rebase, merge, or checkout-detach”, “submodule update” can allow a custom command to be used in to update the working tree of submodules via the “submodule.*.update” configuration … Read more

Git Submodule to a subfolder

Git does not support partial checkouts, so the submodule must point to a complete repository. This thread on the Git mail list provides some background information. This article from Panther Software offers some insight from someone else trying to accomplish a similar goal (i.e. replicate svn:externals using Git). If both projects are under your control, … Read more

How to import python file from git submodule

you can add to sys.path in the file you want to be able to access the module, something like: import sys sys.path.append(“/home/me/myproj/gitmodules”) import mygitsubmodule This example is adding a path as a raw string to make it clear what’s happening. You should really use the more sophisticated, system independent methods described below to determine and … Read more

Why does git submodule update fail with “fatal: remote error: upload-pack: not our ref”?

With Git and submodules, you start with a minimum of two Git repositories. One is “your” repository—the main one, which Git will call the superproject. The second Git repository is some other Git repository: there is nothing special about it at all. It’s just that your superproject has in it these two parts: Instructions for … Read more

Git submodule commit hooks

If you have Git 2.10+ you can get the hooks directory by running: `git rev-parse –git-path hooks` Note: by default it is .git/hooks but if you are in a submodule it will be different. Pre Git 2.10+ you would want something like: `git rev-parse –git-dir`/hooks More info at: Find path to git hooks directory on … Read more

How to create a CocoaPod with nested git submodules?

I believe that CocoaPods is created exactly to avoid GIT submodules usage. Here is cool explanation why: https://roadfiresoftware.com/2013/05/a-case-for-switching-to-cocoapods-from-git-submodules/ Let’s say your project depends on AFNetworking. You add it as a git submodule, and then, someday, due to an Act of God (or just because the author feels like it), AFNetworking disappears from its home on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)