我有一个PHP项目文件夹,文件太多,
如果在项目根文件夹中使用git init
,那将是浪费时间。
现在我只想版一些文件夹,
--------------
FolderA
----data
----class
------class1
------class2
----html
------front
------backend
---------------
我只希望版本为class
和front
,
怎么做? 感谢
答案 0 :(得分:1)
git init
只创建一个空白的Git存储库,与空的目录相比,没有什么能比较大的目录更耗时。
要为FolderA
创建Git存储库并将class
和html/front
目录添加到其中,请执行以下操作:
cd FolderA
git init
git add class
git add html/front
git commit
如果您想保留其他文件夹,最好还要创建一个包含以下内容的.gitignore
文件:
/data
/html/backend
将其保存到文件夹FolderA
中,并使用git add
将其添加到存储库并提交更改。
答案 1 :(得分:0)
使用.gitignore文件并选择:
答案 2 :(得分:0)