Answer the question
In order to leave comments, you need to log in
How to commit subfolder files in Git?
Good afternoon,
Let's say I have the following structure:
file1
Folder1
--file1
Folder2
--Subfolder1
----file1
----file2
How can I commit all files, including those in subfolders?
Git creates folders (including those on github), but leaves them empty.
Tried the default:
git clone https://...
<Добавляю папки с файлами в склонированный репозиторий>
git add .
git commit -m "Добавил папки"
git push origin <branch_name>
Answer the question
In order to leave comments, you need to log in
This is surprising because git doesn't actually know how to commit empty directories. There must be at least one file.
If you want to commit everything at all - do git add .
(pay attention to the dot) before git commit
.
And make sure your .gitignore doesn't make git ignore new files.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question