如何添加src目录而不是单个文件? [英] How do I add the src directory instead of the individual files?

查看:147
本文介绍了如何添加src目录而不是单个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为"src"的目录,其中包含文件"level.txt"和"notes.txt":

I've created a directory called 'src' which contain the files 'level.txt' and 'notes.txt':

Remys:git-practice Remyce$ cd src

Remys:src Remyce$ ls

level.txt   notes.txt


如何添加src目录而不是单个文件?它不断提出:


How do I add the src directory instead of the individual files? It keeps coming up with:

Remys:src Remyce$ add src

-bash: add: command not found

我还需要将文件提交到存储库.

I also need to commit the files to the repo.

推荐答案

基本上,git使用路径名来管理文件,即,一个节点代表一个文件,而不是文件夹.因此您不能仅在运行git add时指定文件夹名称.

Basically, git manage files with pathname, i.e. one node for one file, instead of folder. so you can not specify folder name only when run git add.

请尝试以下命令.

git add src/*
git status

现在,您可以看到level.txt和notes.txt在待提交"列表中.

Now you can see level.txt and notes.txt are in "to-be-committed" list.

这篇关于如何添加src目录而不是单个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆