正试图提交一些更改。我用git add
添加了我可能使用通配符*.js
创建的任何新JavaScript文件。然后我承诺更改并推送到github:“git add * .js”未添加子目录中的文件
git add *.js git commit -m "stuff" git push github master
当我检查github时,我所编辑的所有文件都是空白的。他们在那里,只是空着。
然后我试图再次提交,但GIT说,一切都是最新的。
然后我回去注意到,在我做了git commit -m "stuff"
之后,GIT显示了一条消息,说我的一堆“.js”文件没有上演,即使我刚刚使用通配符添加它们:git add *.js
。这是我尝试提交时显示的消息。
# On branch master # Changes not staged for commit: # (use "git add/rm ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: src/static/directory1/js/module1/file1.js # modified: src/static/directory1/js/module1/file2.js # modified: src/static/directory1/js/module2/file1.js
为了解决这个问题,我不得不走下来几个目录做时,我的git add
:
git add src/static/directory1/*.js
这似乎工作,因为这些文件都在那里后,我再次承诺,然后推到github:
git commit -m "stuff" git push github master
这是怎么回事,为什么我必须导航几个目录才能使通配符工作?
谢谢!
这实际上是唯一能在我的机器上运行的东西,非常感谢! – 2012-08-17 00:43:00