Skip to content

Instantly share code, notes, and snippets.

@itarato
Created November 23, 2015 14:06
Show Gist options
  • Select an option

  • Save itarato/d4cc7da16acbd319ca4a to your computer and use it in GitHub Desktop.

Select an option

Save itarato/d4cc7da16acbd319ca4a to your computer and use it in GitHub Desktop.
Workaround to have a version controlled project in another where git submodule is not allowed

Anti-submodule workaround

Workaround to have a version controlled project in another where git submodule is not allowed. This toggles the git files.

Into global gitignore

**/hide.git
**/hide.gitignore

Into ~/.bashrc (or ~/.zshrc)

gitswitch() {
  if [ ! -d .git ]; then
    mv hide.git .git
    mv hide.gitignore .gitignore
  else
    mv .git hide.git
    mv .gitignore hide.gitignore
  fi
}
'''

# Usage

- step into "submodule"
- $> gitswitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment