On 04/11/2011 12:16 PM, Dave Cohen wrote:
When I run `git diff`, I see changes to all the modified files, but I do not 
see the new files.
Git allows (actually assumes) that a directory might have various degrees of "dirt" in it. Unapplied patches, your half composed manifesto about the importance of not hacking core, etc.

A git diff just compares the changes in the "tracked" files that git has been told to care about. Its a good neighbor basically.

To do what you want above, just temporarily tell git to care about your new files with "git add ." or listing them by name and then run "git diff HEAD".

These two steps tell git to care about the file then ask whats different.

You can of course unstage your files if you dont want to actually commit them using git "git reset HEAD". None of these chanegs actually destroy any data except temporary data in the git index. Your files will all remain intact as you want.

A more common use case is to use git commits to track your progress ona feature/bug branch as you go and git diff between two named commits instead.

YMMV.

--
Michael Favia                   [email protected]
tel. 512.669.5650            http://www.favish.com

Reply via email to