From: webmaster@peter-speer.de
To: Mike Rappazzo <rappazzo@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: git diff
Date: Wed, 12 Oct 2016 15:51:08 +0200 (CEST) [thread overview]
Message-ID: <1259748848.41944.1476280268674.JavaMail.open-xchange@app08.ox.hosteurope.de> (raw)
In-Reply-To: <CANoM8SUtrV8CD8M=4CUB8xr9gQj_hKzGOdjQZHuz4+36y_UfJw@mail.gmail.com>
Thanks, Mike. Now I understood.
-fuz
> Mike Rappazzo <rappazzo@gmail.com> hat am 12. Oktober 2016 um 13:06
> geschrieben:
>
> On Wed, Oct 12, 2016 at 6:50 AM, <webmaster@peter-speer.de> wrote:
> > Hi.
> >
> > I created a new branch named hotfix from master.
> > I switched to the branch, changed 1 file.
> >
> > Now I want to see the diff from the both using
> >
> > git diff hotfix master
> >
> > I do not see any output (difference).
> > When I do a git status I see my file with status mofified, not staged for
> > commit.
>
> Since you just created the branch, and did not add any content, there
> is no difference to see. A branch is just a pointer to a commit. You
> now have two pointers pointing at the same commit.
>
> If you want to see the difference between your changes and the master
> branch, you can omit the first reference:
>
> git diff master
>
> When you start adding commits to your hotfix branch, you will be able
> to see the diff between that and master with the command that you
> gave. However, your arguments may be in the reverse order than what
> you expect. You want to specify master first because that is the
> mainline branch (I presume).
>
> When you have several commits on your hotfix branch, you can refer to
> older commits to diff against. There are several ways to refer back,
> but the simplest is to use a tilde '~' followed by a number to count
> back. For example 'hotfix~1' refers to the parent commit on the
> hotfix branch. There is a lot in the documentation[1], so take a look
> there for more info.
>
> Good luck.
> _Mike
>
> [1] https://git-scm.com/doc
>
> > Also, I can see that I am working with the correct branch, hotfix
> >
> > What am I doing wrong?
> >
> > -fuz
>
> On Wed, Oct 12, 2016 at 6:50 AM, <webmaster@peter-speer.de> wrote:
> > Hi.
> >
> > I created a new branch named hotfix from master.
> > I switched to the branch, changed 1 file.
> >
> > Now I want to see the diff from the both using
> >
> > git diff hotfix master
> >
> > I do not see any output (difference).
> > When I do a git status I see my file with status mofified, not staged for
> > commit.
> > Also, I can see that I am working with the correct branch, hotfix
> >
> > What am I doing wrong?
> >
> > -fuz
>
next prev parent reply other threads:[~2016-10-12 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 10:50 git diff webmaster
2016-10-12 11:06 ` Mike Rappazzo
2016-10-12 13:51 ` webmaster [this message]
[not found] <AANLkTi=ASvicFGaaDfqxjOxJELWPLKsQwvk7rEeT36Fh@mail.gmail.com>
2011-01-13 22:46 ` Carter Lamb
2011-01-17 22:30 ` Jeff King
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=1259748848.41944.1476280268674.JavaMail.open-xchange@app08.ox.hosteurope.de \
--to=webmaster@peter-speer.de \
--cc=git@vger.kernel.org \
--cc=rappazzo@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).