Staging Deleted files

Since Git 2.0.0, git add will also stage file deletions. Git 2.0.0 Docs – git-add < pathspec >… Files to add content from. Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to update the index to match the current … Read more

How can I add a blank directory to a Git repository?

Another way to make a directory stay (almost) empty (in the repository) is to create a .gitignore file inside that directory that contains these four lines: Then you don’t have to get the order right the way that you have to do in m104’s solution. This also gives the benefit that files in that directory … Read more

Difference between “git add -A” and “git add .”

This answer only applies to Git version 1.x. For Git version 2.x, see other answers. Summary: git add -A stages all changes git add . stages new files and modifications, without deletions (on the current directory and its subdirectories). git add -u stages modifications and deletions, without new files Detail: git add -A is equivalent to git add .; git add -u. The important point … Read more