Git只检查顶级

时间:2014-01-20 22:48:44

标签: git bitbucket

我刚刚开始使用Git。我想采取我创建的项目并将其上传到BitBucket。文件结构是嵌套的,就像普通的软件项目一样。问题是我只提交了最高级别的文件/文件夹。我是否必须浏览我的解决方案/项目中的每个文件夹并手动检查它们?这就是我在做的事情:

$ git init
$ git add . #Isn't this supposed to iterate through the nested fodders?
$ git commit - m "some comment here..."
$ git push -u origin master

我希望这会检查我的解决方案中的所有文件,但它只检查第一个嵌套级别的文件夹。

任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:2)

使用git add -A代替git add .这将添加所有内容。

从手册页:

-A, --all
           Like -u, but match <filepattern> against files in the working tree in
           addition to the index. That means that it will find new files as well
           as staging modified content and removing files that are no longer in
           the working tree.

专业提示:

aa别名git add -A && git status -s。这几乎总是我想根据我的工作流程做的事情(请添加我的所有更改),然后向我显示状态,以便我准备好提交。 aa因为它非常容易输入。

在bash中:

aa='git add -A && git status -s'

答案 1 :(得分:0)

尝试git add *git add directory递归添加目录和所有文件。

相关问题