title: AndroidStudio is not committing MainActivity.java to Github
body: <p>Git seems to be tracking the java folder, but I can't commit changes to the specific file <code>MainActivity.java</code>. I get a "Changes not staged for commit"
  The diff shows the changes, but I can't commit it.</p>
  
  <p>Also, I can't go down into the folder in Github.</p>
  
  <p><a href="https://i.stack.imgur.com/UwyLo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UwyLo.png" alt="Project structure"></a>
  <a href="https://i.stack.imgur.com/Mkc9z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mkc9z.png" alt="Commit error"></a></p>
  
  <p><a href="https://i.stack.imgur.com/mWou5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mWou5.png" alt="Github structure"></a>
  That folder is not clickable.</p>
  
  <p><strong>Edit:</strong> When I do <code>git status</code> in the command line, I get</p>
  
  <pre><code>user:JustJava juil$ git status
  HEAD detached at 93ea9a1
  Changes not staged for commit:
    (use "git add &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
    (commit or discard the untracked or modified content in submodules)
  
          modified:   app/src/main/java/com/example/android/justjava (modified content)
  
  no changes added to commit (use "git add" and/or "git commit -a")
  </code></pre>
  
  <p><strong>Edit 2:</strong> I have checked out the latest commit as some have suggested but still get the detached head error.</p>
  
  <p><a href="https://i.stack.imgur.com/jW3a7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jW3a7.png" alt="Current git log"></a></p>
  
  <p><strong>Edit 3:</strong> I tried adding the file itself w/ <code>git add</code> but got an error that the directory is a submodule.</p>
  
  <pre><code>JustJava juil$ git add app/src/main/java/com/example/android/justjava/MainActivity.java
  fatal: Pathspec 'app/src/main/java/com/example/android/justjava/MainActivity.java' is in submodule 'app/src/main/java/com/example/android/justjava'</code></pre>
  
  <p>I tried running <code>git submodule status</code> and got the error</p>
  
  <pre><code>fatal: no submodule mapping found in .gitmodules for path 'app/src/main/java/com/example/android/justjava'
  </code></pre>
  
  <p>I tried deleting <code>.git</code> in the submodule, but the same error keeps popping up.</p>