git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neal Kreitzinger <nkreitzinger@gmail.com>
To: Patrick Sabin <patrick.just4fun@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to git diff files in renamed directories
Date: Thu, 15 Mar 2012 05:30:19 -0500	[thread overview]
Message-ID: <4F61C4BB.20908@gmail.com> (raw)
In-Reply-To: <CAGATVH7KCr+dJNpx18==3BT8pzsvKeV5aYRWKts7xH0YZ8yaKw@mail.gmail.com>

On 3/15/2012 3:32 AM, Patrick Sabin wrote:
>
> I want to diff a renamed file (to a different directory) in different commits.
>
> File a was moved to the file subdir/c
>
> I tried:
>
> $ git diff b616d 0aa0 -- subdir/c a
>
> but git seems to always diff against /dev/null:
>
> diff --git a/a b/a
> new file mode 100644
> index 0000000..2e5ada8
> --- /dev/null
> +++ b/a
> @@ -0,0 +1 @@
> +File a
> diff --git a/subdir/c b/subdir/c
> deleted file mode 100644
> index 24c846c..0000000
> --- a/subdir/c
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -File b
> -Another b change.
>
> git log --follow subdir/c   recognizes that the file has been renamed
> and moved to subdirectory.
>
> Is there any way to get such a diff in git?
>
git diff b616d:a 0aa0:subdir/c is one way to do it.

v/r,
neal

  parent reply	other threads:[~2012-03-15 10:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  8:32 How to git diff files in renamed directories Patrick Sabin
2012-03-15  8:51 ` Damien Wyart
2012-03-15 10:30 ` Neal Kreitzinger [this message]
2012-03-15 20:49 ` Junio C Hamano

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=4F61C4BB.20908@gmail.com \
    --to=nkreitzinger@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=patrick.just4fun@gmail.com \
    /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).