dtletmn wrote:
Hi,All, I am wondering if cvs has an easy way to compare a file with its previous version. In clearcase,I can use : cleartool diff -pred file.cc how can I acheive it in CVS? any help would be highly appreciated!
Why you're posting this to the git mailing list I have no idea, but assuming you mean "how do I compare a file in git with the content it had in the previous snapshot?", the answer would be: git diff HEAD^ -- path/to/file This command works equally well on directories or multiple paths. Note that if there are no differences, the program will just exit silently. If you want to see the differences compared to the *latest* commit, you'd do git diff HEAD -- path/to/file If you want to see the differences compared to what you've staged for committing next, you'd do git diff -- path/to/file If you want to see the differences between what you've already staged and the latest snapshot, you'd do git diff --staged -- path/to/file -- Andreas Ericsson andreas.ericsson@xxxxxx OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html