In this tutorial you will learn how to commit an empty directory in Git. In order to do this you will have to make a hack: commit a file located inside of the directory that you want to commit. Most of the time that file name is .gitignore. Remember that Git is a VCS used for tracking files and not directories. The directories are used just to structure the file system.
Code used during this tutorial:
# Git Commit empty directory
# Ignore everything in this directory
# Except this file
git add .
git commit -m "Add images upload dir"
# Useful links