本文介绍了在Git中添加文件夹/子文件夹/文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何以递归方式添加一个包含子文件夹及其文件的文件夹?
How can I add a folder recursively, with its subfolders and its files?
当我使用 git add folder_name
时,只会添加该文件夹.现在, git status
会显示子文件夹下的文件,这些文件显示为新文件,并且未跟踪.
When I use git add folder_name
, only that folder is getting added. git status
now shows the files under the subfolders are shown as new files and untracked.
例如,在Rails应用程序中,Rails项目文件夹中有许多文件夹:
For example, in Rails application, inside the Rails project folder, there are many folders:
- 应用
- 公开
- db
- 脚本
- 供应商
- 等
是否有更好的方法将rails项目添加到git中?
Is there a better way to add a rails project to git?
推荐答案
cd desired_directory; git add .;
嗯,看来我在打字时贾斯汀·L.(Justin L.)在评论中回答了这个问题.
Er, it looks like this was answered by Justin L. in a comment while I as typing.
这篇关于在Git中添加文件夹/子文件夹/文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!