Accidentally created a git submodule

So I was developing a API Client gem, which was working great, had it’s own github repository and my team lead decided that he wanted me to move this client api into the api repository itself. So I copied the files over into it’s own directory, removed the .git directory from the client’s directory, and merged it into master. Worked great.

However, now when I try to create a branch off of master, the directory shows up a submodule on github, and isn’t tracked in my local git. There is no .gitmodules folder, and no mention of submodules whatsoever. I can’t create a new branch because it says that there are untracked files that will get overwritten (all the files in my client gem directory) but as far as I can tell there’s no way for me to start tracking these files. I can access the directory just fine, but as soon as I modify a file, the change doesn’t show up in the api projects git.

  • Developing gems and using them in rails projects with bundler, is there a faster way?
  • Building pry plugin(gem) with bundler
  • Gem is not checked out. Please run `bundle install` in Heroku
  • vagrant install plugin from github
  • Is there a gem to make Git and Rails work together for more robust migrations?
  • How to get an application to use a local branch version of Ruby on Rails
  • What do I do?

  • Using git svn with some awkward permissions
  • Git problems with git push --all
  • Restore uncommitted work after checkout and reset
  • Understanding pycharm commit log for hard reset before incorrect merge
  • How to debug Jenkins error message “could not find a suitable ssh-agent provider”?
  • What's a good process for managing persistent codelines in git?
  • 2 Solutions collect form web for “Accidentally created a git submodule”

    Running git rm --cached --ignore-unmatch client then allowed me to git add client/

    If there is no .git folder or file in that subfolder, all you need to do is git rm --cached [folder] followed by git add [folder]/*

    Git Baby is a git and github fan, let's start git clone.