Skip to content

Instantly share code, notes, and snippets.

@Ajwah
Created June 29, 2015 05:30
Show Gist options
  • Save Ajwah/8217a3b0f70f2621f2cf to your computer and use it in GitHub Desktop.
Save Ajwah/8217a3b0f70f2621f2cf to your computer and use it in GitHub Desktop.
Git: fatal: Pathspec is in submodule
https://stackoverflow.com/questions/24472596/git-fatal-pathspec-is-in-submodule/24473037#24473037
Problem:
I was unable to commit changes to a repository I cloned as a subdirectory to my existing project directory.
✘ ☪  ~/Documents/Python   master±  git add fullstack/vagrant/forum/*.*
fatal: Pathspec 'fullstack/vagrant/forum/forum.py' is in submodule 'Python/fullstack'
In this case, Python is the main project directory I would commit to github.
fullstack is a repo I cloned from udacity as a subdirectory.
After making changes in the files contained in the sub directory and attempting to commit those changes, I would get the above error.
@Ajwah
Copy link
Author

Ajwah commented Jul 2, 2015

Easier work around:
Delete the .git repo
then:
git rm -rf --cached CocktailMakerModule/
git add CocktailMakerModule/

http://stackoverflow.com/questions/23612012/fatal-pathspec-autoload-classmap-php-is-in-submodule-module-cocktailmakermod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment