Let's say that I have a directory called REPO with an initiated git repo in it, in that directory, there's 2 subdirectories called sub1
, sub2
and a "1.cpp
" file.
sub1
has "2.cpp
" file and other files.
sub2
has "3.cpp
" file and other files, so It'll be exactly like this diagram
Now I want only these files in my repository without any directories
1.cpp
2.cpp
3.cpp
I know how to ignore all files except .cpp
files using .gitignore
but I don't want sub1
and sub2
to be included in my repo, I only want the cpp
files in them, I have searched a lot but couldn't find an answer, I hope I could explain it properly.