Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github changes not staged for commit

Tags:

git

github

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?

like image 239
Ryan Tice Avatar asked May 23 '12 14:05

Ryan Tice


People also ask

How do I see changes not staged for commit?

If you just want to see the diff without committing, use git diff to see unstaged changes, git diff --cached to see changes staged for commit, or git diff HEAD to see both staged and unstaged changes in your working tree.

Will git commit staged changes?

When you're ready to save a copy of the current state of the project, you stage changes with git add . After you're happy with the staged snapshot, you commit it to the project history with git commit . The git reset command is used to undo a commit or staged snapshot.

Do you have to stage changes before commit?

Staging. Before we make a commit, we must tell Git what files we want to commit (new untracked files, modified files, or deleted files). This is called staging and uses the add command.


2 Answers

Have you tried

git add . 

This recurses into sub-directories, whereas I don't think * does.

See here

like image 56
g-eorge Avatar answered Oct 08 '22 06:10

g-eorge


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.

like image 27
Waleed Asender Avatar answered Oct 08 '22 05:10

Waleed Asender