/pivot-submodule-git-dir

Fix problems derived from the Git submodules' ".git" directory not being the real Git repository directory.

Primary LanguageShell

The pivot-submodule-git-dir utility

Fix problems derived from the Git submodules' ".git" directory not being the real Git repository directory.

https://gitlab.com/brlin/pivot-submodule-git-dir
The GitLab CI pipeline status badge of the project's main branch GitHub Actions workflow status badge pre-commit enabled badge REUSE Specification compliance badge

The problem

Git submodules can't be easily mounted into a VM or container without breaking the Git functionality within the VM or container.

The workaround

The utility program provided by this solution swaps the actual Git repository directory of the submodule back to the ".git" directory entry of the submodule worktree, while maintaining a symbolic link from the original location to maintain functionality of basic Git operations(commit/log).

Limitation

Note that as Git itself isn't aware of the change the submodule will become broken when path-related changes are made to the submodule, we expect the user to aware of this limitation and interact with it accordingly.

Installatioon

Follow the following instructions to install the product:

  1. Download the release archive of the product from the Releases page.
  2. Extract the release archive using your preferred archive manipulation application/program.
  3. Install the pivot-submodule-git-dir program to the .local/bin sub-directory of your home directory, ensure the installed program has executable Unix file permission set.
  4. Ensure the "${HOME}/.local/bin" directory is in your command search PATHs.

Usage

Follow the following instructions to use the product:

  1. Launch your preferred text terminal.

  2. Change the working directory to the submodule worktree directory you wish to operate on.

  3. Run the following command to start the operation:

    pivot-submodule-git-dir

Licensing

Unless otherwise noted(individual file's header/REUSE.toml), this product is licensed under the 3.0 version of the GNU Affero General Public License, or any of its more recent versions of your preference.

This work complies to the REUSE Specification, refer to the REUSE - Make licensing easy for everyone website for info regarding the licensing of this product.