github changes not staged for commit
I have a very basic github setup with a readme, a directory, and another directory inside it with an html file. On github I can only view the readme and the first folder but none of its contents, and I am getting this message
tc349 ryntc3$ git add *
tc349 ryntc3$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: week1 (modified content)
no changes added to commit (use "git add" and/or "git commit -a")
I feel like if I am adding all to be staged that it should not be an issue. Any help?
Have you tried
git add .
This recurses into sub-directories, whereas I don't think * does.
See here
WARNING! THIS WILL DELETE THE ENTIRE GIT HISTORY FOR YOUR SUBMODULE. ONLY DO THIS IF YOU CREATED THE SUBMODULE BY ACCIDENT. CERTAINLY NOT WHAT YOU WANT TO DO IN MOST CASES.
I think you have to go inside week1 folder and delete the .git folder:
sudo rm -Rf .git
then go back to top level folder and do:
git add .
then do a commit and push the code.
in my case, I needed a
git add files
git commit -am 'what I changed'
git push
the 'a' on the commit was needed.
Is week1
a submodule?
Note the relevant part from the output of the git status
command:
(commit or discard the untracked or modified content in submodules)
Try cd week1
and issuing another git status
to see what changes you have made to the week1
submodule.
See http://git-scm.com/book/en/Git-Tools-Submodules for more information about how submodules work in Git.
WARNING! THIS WILL DELETE THE ENTIRE GIT HISTORY FOR YOUR SUBMODULE. ONLY DO THIS IF YOU CREATED THE SUBMODULE BY ACCIDENT. CERTAINLY NOT WHAT YOU WANT TO DO IN MOST CASES.
In my situation, there was a sub-directory which had a .git
directory.
What I do is simply remove that .git
directory from my sub-directory.