git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: dtletmn <dtletmedn@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Does CVS has a easy way to compare file with its previous version?
Date: Tue, 30 Jun 2009 13:32:15 +0200	[thread overview]
Message-ID: <4A49F7BF.9070209@op5.se> (raw)
In-Reply-To: <1e56aa11-735a-47f7-a273-5b6bf611f528@n11g2000yqb.googlegroups.com>

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@op5.se
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.

  reply	other threads:[~2009-06-30 11:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30  7:41 Does CVS has a easy way to compare file with its previous version? dtletmn
2009-06-30 11:32 ` Andreas Ericsson [this message]
2009-06-30 12:36 ` Jakub Narebski
2009-06-30 23:28   ` Paolo Bonzini
2009-07-01  1:18     ` Linus Torvalds
2009-07-02 18:04       ` Eric Raible
2009-07-03  6:39         ` Paolo Bonzini
2009-07-06 23:39           ` Eric Raible
2009-07-07 19:57             ` Paolo Bonzini
2009-07-01  0:29 ` dtletmn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A49F7BF.9070209@op5.se \
    --to=ae@op5.se \
    --cc=dtletmedn@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).