This is actually an extension of the existing syntax: this kind of name has been valid gitrevisions syntax for a long time.
The designated colon name usually 1 refers to the paths inside the index (staging area), in the same way that the version name followed by the colon and path refers to the paths in this revision: master~3:foo is the version of the foo file in the master branch three versions back. Thus :foo is the version of foo delivered for the next commit.
Note, however, that the colon followed by a slash is usually used to search for commits by commit log messages, as in the example :/fix in gitrevisions.
These path names are typically embedded at the top of the tree (and not wherever you are in the working tree). For example, if your repository has only two files, but they are called README and dir/sub.txt , and you are in dir , you still write master~3:dir/sub.txt and master~3:README . You can get git to automatically search in dir/ by forcing the relative path: git show master~3:./sub.txt and git show master~3:../README . If the value :/fix means searching for fix messages, the leading slash cannot be used here to indicate the top of the tree, but since paths always start at the top, this is not necessary.
In the case of git add , however, you canβt actually refer to what is being put now - you are trying to add material to compose it, why should it be given now? -so :path means add the file to the current tree. For some ridiculous reason 2 , unlike other git commands, git add works based on your current working directory even with a colon syntax, so if you are in dir/ and you write git add :sub.txt by adding ./sub.txt . You cannot git add :README from here. But you can (with git 1.8 at least - I'm not sure how long it has been in place) git add :/README , where the leading slash means "display the current subdirectory and go to the beginning of the repository tree" ,.
If you leave the rest of the path name, you will get :/ , which really looks like an emoticon! But this refers to the directory at the top of the repository. But only for git add ; for other git commands, this means a search string for the commit message.
1 The value is not always. git exceptions to its many rules are usually reasonable, but difficult to explain. :-)
2 Meaning "I do not know why." Of course, this makes sense for paths with a prefix without a colon, but for colon with a prefix, why? (It was probably just easier to implement, given the bunch of existing code.)