tags:

views:

57

answers:

1

Every time I do a git diff, despite a MILLION commits since the first one, it keeps on giving me these REALLY OLD changes that were committed AGES ago to do with file deletions.

I deleted an entire folderful of stuff in a commit about 7 commits ago, and still on branch or merge, git acts like the deletion is new. Doing GIT DIFF STILL shows every line of the deleted files as "just having been deleted", as if this is new, but I deleted them MANy commits ago.

What's going on?

+5  A: 

How are you adding files to your index? git add . won't add deleted files to your index, you've got to either use git add -u or git rm filename.txt

kubi
Or my favorite, "git commit -a ...", which just does what I want, most of the time. :) And "git status" is your friend.
Randal Schwartz
It's a good habit to *always* check what `git status` has to say before you actually do your commits.
Dan Moulding
I consider `git add .` and `git status` to be pretty much one command, since I always use them together.
kubi