When I git add
a folder, the whole content and all subfolders are staged automatically. In case the folder contains subfolders which I do not want to commit, I have to unstage them manually and add them to .gitignore
afterwards. The explicit unstaging feels like I'm doing something wrong here.
A solution would be to edit the .gitignore
before adding. But in cases where the folder structure is very deep/complex this is a bit tricky, because it is easy to forget to ignore certain deeply nested files/folders.
What I was looking for is a step-wise add
like SVN's --non-recursive
, allowing to add folders level by level without staging the whole content. However I couldn't find this functionality for git add
. So I'm wondering: What is the recommended git workflow for such a non-recursive add?
Considering that others had the exact opposite problem: Maybe the behavior I described above is an issue with my git version (1.9.1) / settings?