[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gits] Git question about local version diffs



Or,

git diff master origin/master

if you want to see the different between your *current* committed state 
and the upstream

(git diff uses the same argument order as 'regular' diff, so you might 
want to reverse master and origin/master)

On 22 Feb 2013, at 12:20, Kirk Webb wrote:

> You can list the commit hashes with 'git log', then use them, or a
> relative reference to them (e.g. 'HEAD~2') to provide to 'git diff'
> like so:
>
> git diff <commit_hash> origin/master   # assuming you are working on
> the master branch
>
> or
>
> git diff HEAD~2 origin/master
>
> On Fri, Feb 22, 2013 at 11:50 AM, Dan Reading <dreading at flux.utah.edu> 
> wrote:
>> How do I get a list of my local commits and display diffs.
>>
>> For example if I do a 'get status' it says that I'm 4 commits ahead 
>> of
>> the master ( I have not done a 'git push' ).
>> I would like select two of the commits and see the diffs of the 
>> files.
>>
>> Thanks,
>> Dan