From: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
To: Fabrice Creuzot <code@luigifab.fr>
Cc: git@vger.kernel.org
Subject: Re: git a/xyz or b/xyz
Date: Sat, 18 Jun 2022 19:15:01 +0800 [thread overview]
Message-ID: <CAJyCBOSc_n0is=77Ua_VZbce81qA0yKbUm6Dp2TxxpFAgVQ1OA@mail.gmail.com> (raw)
In-Reply-To: <CAJyCBORdr3kaBbBmec5T5JAjcUpq6mSKQC=8_poLaZzSpkMJLA@mail.gmail.com>
On Sat, Jun 18, 2022 at 7:09 PM Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> wrote:
>
> On Sat, Jun 18, 2022 at 6:50 PM Fabrice Creuzot <code@luigifab.fr> wrote:
> >
> > Hello
> >
> > When we are reading a "git diff", all paths are prefixed with "a/" and
> > "b/". Example:
> > diff --git a/xyz
> > index 4aa4b5230..1c2b8b69e 100644
> > --- a/xyz
> > +++ b/xyz
> > @@ -1,7 +1,7 @@
> >
> >
> > With my terminal, I double click on the path to select the full path for
> > copy.
> >
> > Then, when I paste: "git log a/xyz",
> > git says: unknown revision or path not in the working tree
> >
> > Ok, I need to remove the "a/" or "b/".
> > But, is git can understand that "a/xyz" is "xyz" because "a/xyz" does
> > not exist?
> >
> > Thanks
>
> Hi Fabrice,
>
> You can think that "a/" stands for "before" or "old content", whereas
> "b/" stands for "after" or "new content". Paths are prefixed with these
> to indicate which is before and which is after.
>
> For example, when you call "git diff", it is to "view the changes you made
> relative to the index (staging area for the next commit)".
> In this case, "before" is the index, namely "a/", whereas "after"
> is your current working tree, namely "b/".
A more precise way of saying is "a/" stands for source, whereas "b/"
stands for destination.
--
Thanks & Regards,
Shaoxuan
next prev parent reply other threads:[~2022-06-18 11:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-18 10:45 git a/xyz or b/xyz Fabrice Creuzot
2022-06-18 11:09 ` Shaoxuan Yuan
2022-06-18 11:15 ` Shaoxuan Yuan [this message]
2022-06-20 11:12 ` Konstantin Khomoutov
2022-06-24 15:58 ` Fabrice Creuzot
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJyCBOSc_n0is=77Ua_VZbce81qA0yKbUm6Dp2TxxpFAgVQ1OA@mail.gmail.com' \
--to=shaoxuan.yuan02@gmail.com \
--cc=code@luigifab.fr \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).