{"thread":{"id":"44287","subject":"git diff","startedAt":"2016-10-12T10:51:03Z","lastAt":"2016-10-12T13:51:29Z","messageCount":3,"participants":["webmaster@peter-speer.de","Mike Rappazzo"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"303972","messageId":"1066408917.43087.1476269456819.JavaMail.open-xchange@app06.ox.hosteurope.de","threadId":"44287","inReplyTo":null,"subject":"git diff","fromName":"","fromEmail":"webmaster@peter-speer.de","sentAt":"2016-10-12T10:50:56Z","receivedAt":"2016-10-12T10:51:03Z","isPatch":false,"sender":{"key":"webmaster@peter-speer.de","avatar":null},"body":"Hi.\n\nI created a new branch named hotfix from master.\nI switched to the branch, changed 1 file.\n\nNow I want to see the diff from the both using\n\ngit diff hotfix master\n\nI do not see any output (difference).\nWhen I do a git status I see my file with status mofified, not staged for\ncommit.\nAlso, I can see that I am working with the correct branch, hotfix\n\nWhat am I doing wrong?\n\n-fuz\n"},{"id":"303974","messageId":"CANoM8SUtrV8CD8M=4CUB8xr9gQj_hKzGOdjQZHuz4+36y_UfJw@mail.gmail.com","threadId":"44287","inReplyTo":"1066408917.43087.1476269456819.JavaMail.open-xchange@app06.ox.hosteurope.de","subject":"Re: git diff","fromName":"Mike Rappazzo","fromEmail":"rappazzo@gmail.com","sentAt":"2016-10-12T11:06:05Z","receivedAt":"2016-10-12T11:06:31Z","isPatch":false,"sender":{"key":"rappazzo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/525287?v=4"},"body":"On Wed, Oct 12, 2016 at 6:50 AM,  <webmaster@peter-speer.de> wrote:\n> Hi.\n>\n> I created a new branch named hotfix from master.\n> I switched to the branch, changed 1 file.\n>\n> Now I want to see the diff from the both using\n>\n> git diff hotfix master\n>\n> I do not see any output (difference).\n> When I do a git status I see my file with status mofified, not staged for\n> commit.\n\nSince you just created the branch, and did not add any content, there\nis no difference to see.  A branch is just a pointer to a commit.  You\nnow have two pointers pointing at the same commit.\n\nIf you want to see the difference between your changes and the master\nbranch, you can omit the first reference:\n\n    git diff master\n\nWhen you start adding commits to your hotfix branch, you will be able\nto see the diff between that and master with the command that you\ngave.  However, your arguments may be in the reverse order than what\nyou expect.  You want to specify master first because that is the\nmainline branch (I presume).\n\nWhen you have several commits on your hotfix branch, you can refer to\nolder commits to diff against.  There are several ways to refer back,\nbut the simplest is to use a tilde '~' followed by a number to count\nback.  For example 'hotfix~1' refers to the parent commit on the\nhotfix branch.  There is a lot in the documentation[1], so take a look\nthere for more info.\n\nGood luck.\n_Mike\n\n[1] https://git-scm.com/doc\n\n\n> Also, I can see that I am working with the correct branch, hotfix\n>\n> What am I doing wrong?\n>\n> -fuz\n\nOn Wed, Oct 12, 2016 at 6:50 AM,  <webmaster@peter-speer.de> wrote:\n> Hi.\n>\n> I created a new branch named hotfix from master.\n> I switched to the branch, changed 1 file.\n>\n> Now I want to see the diff from the both using\n>\n> git diff hotfix master\n>\n> I do not see any output (difference).\n> When I do a git status I see my file with status mofified, not staged for\n> commit.\n> Also, I can see that I am working with the correct branch, hotfix\n>\n> What am I doing wrong?\n>\n> -fuz\n"},{"id":"303991","messageId":"1259748848.41944.1476280268674.JavaMail.open-xchange@app08.ox.hosteurope.de","threadId":"44287","inReplyTo":"CANoM8SUtrV8CD8M=4CUB8xr9gQj_hKzGOdjQZHuz4+36y_UfJw@mail.gmail.com","subject":"Re: git diff","fromName":"","fromEmail":"webmaster@peter-speer.de","sentAt":"2016-10-12T13:51:08Z","receivedAt":"2016-10-12T13:51:29Z","isPatch":false,"sender":{"key":"webmaster@peter-speer.de","avatar":null},"body":"Thanks, Mike. Now I understood.\n\n-fuz\n\n> Mike Rappazzo <rappazzo@gmail.com> hat am 12. Oktober 2016 um 13:06\n> geschrieben:\n> \n> On Wed, Oct 12, 2016 at 6:50 AM, <webmaster@peter-speer.de> wrote:\n> > Hi.\n> >\n> > I created a new branch named hotfix from master.\n> > I switched to the branch, changed 1 file.\n> >\n> > Now I want to see the diff from the both using\n> >\n> > git diff hotfix master\n> >\n> > I do not see any output (difference).\n> > When I do a git status I see my file with status mofified, not staged for\n> > commit.\n> \n> Since you just created the branch, and did not add any content, there\n> is no difference to see. A branch is just a pointer to a commit. You\n> now have two pointers pointing at the same commit.\n> \n> If you want to see the difference between your changes and the master\n> branch, you can omit the first reference:\n> \n>  git diff master\n> \n> When you start adding commits to your hotfix branch, you will be able\n> to see the diff between that and master with the command that you\n> gave. However, your arguments may be in the reverse order than what\n> you expect. You want to specify master first because that is the\n> mainline branch (I presume).\n> \n> When you have several commits on your hotfix branch, you can refer to\n> older commits to diff against. There are several ways to refer back,\n> but the simplest is to use a tilde '~' followed by a number to count\n> back. For example 'hotfix~1' refers to the parent commit on the\n> hotfix branch. There is a lot in the documentation[1], so take a look\n> there for more info.\n> \n> Good luck.\n> _Mike\n> \n> [1] https://git-scm.com/doc\n> \n> > Also, I can see that I am working with the correct branch, hotfix\n> >\n> > What am I doing wrong?\n> >\n> > -fuz\n> \n> On Wed, Oct 12, 2016 at 6:50 AM, <webmaster@peter-speer.de> wrote:\n> > Hi.\n> >\n> > I created a new branch named hotfix from master.\n> > I switched to the branch, changed 1 file.\n> >\n> > Now I want to see the diff from the both using\n> >\n> > git diff hotfix master\n> >\n> > I do not see any output (difference).\n> > When I do a git status I see my file with status mofified, not staged for\n> > commit.\n> > Also, I can see that I am working with the correct branch, hotfix\n> >\n> > What am I doing wrong?\n> >\n> > -fuz\n\n>\n"}]}