github更改未进行提交

Rya*_*ice 54 git github

我有一个非常基本的github设置,包含自述文件,目录和其中包含html文件的另一个目录.在github上我只能查看自述文件和第一个文件夹,但没有查看其内容,我收到此消息

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")
Run Code Online (Sandbox Code Playgroud)

我觉得如果我要加上所有要上演的那不应该是一个问题.有帮助吗?

小智 66

你有没有尝试过

git add .
Run Code Online (Sandbox Code Playgroud)

这会递归到子目录,而我认为*不会.

看到这里

  • 当我git status或git commit时,仍然会给我留下相同的消息 (6认同)

Wal*_*der 38

我想你必须进入week1文件夹并删除.git文件夹:

sudo rm -Rf .git
Run Code Online (Sandbox Code Playgroud)

然后返回顶级文件夹并执行:

git add .
Run Code Online (Sandbox Code Playgroud)

然后执行提交并推送代码.

  • 哈哈哈谢谢你!你立刻救了我! (3认同)
  • Gahhh ..不能相信这是因为子文件夹中的.git文件夹.我是正式的白痴......谢谢!! (2认同)

ivo*_*lch 29

就我而言,我需要一个

 git add files
 git commit -am 'what I changed'
 git push
Run Code Online (Sandbox Code Playgroud)

需要提交'a'.

  • 这解决了我的问题"需要提交''' (4认同)

小智 25

week1子模块吗?

请注意git status命令输出中的相关部分:

(提交或放弃子模块中未跟踪或修改的内容)

尝试cd week1并发出另一个,git status以查看您week1对子模块所做的更改.

有关子模块如何在Git中工作的更多信息,请参见http://git-scm.com/book/en/Git-Tools-Submodules.


Mar*_*n W 9

在我的情况下,有一个子目录,其中有一个.git目录.

我所做的只是.git从我的子目录中删除该目录.