在父文件夹和子文件夹中仅存在文件夹。我已使用以下方式删除了所有文件:
find my-path-here -type f -delete
示例设置:
parent-path (this is parent folder for the repo)
-> subfolder1
-> subfolder2
-> subfolder14
-> subfolder67
我尝试添加并提交此设置,但git未添加子文件夹。我已经在网上搜索过,但是除了使用“ git add --all”
之外没有看到其他有用的信息这是我的终端输出:
parent-path on master
➜ rm -rf .git
/home/myuser/parent-path
➜ git init
Initialized empty Git repository in /home/myuser/parent-path/.git/
parent-path on master
➜ git add .
parent-path on master
➜ git add --all
parent-path on master
➜ git add "subfolder1"
parent-path on master
➜ git commit -av -m "initial commit"
On branch master
Initial commit
nothing to commit
parent-path on master
➜ git status
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)
parent-path on master
➜ ls -la .gitignore
Specified path '.gitignore' doesn't exist.
parent-path on master
➜
答案 0 :(得分:1)
您必须在版本控制下向每个目录添加.gitkeep文件