Git is ignoring empty folders - How do I add an empty directory to a Git repository?
If you would like to not see your empty Test
(folder) in the branch where it is empty, you have to delete it in that branch
# Switch branch
git switch empty-folder
# Remove empty folder
rm -r Test
# Check files
tree -a
# Check git status
git status
You will not see any git changes, because it considered Test
folder as empty due to the entry in your .gitignore
- .DS_Store
.
And check the main branch, where folder contains content
# Switch branch
git switch main
# Check files
tree -a
# Check git status
git status