Thanks, Magnus. I have pulled (git pull) before executing the command I 
showed.
On your suggestion (git diff origin/master -- README)

Do I need to specify the path to README or I need to be in the directory 
where README?

Thanks in advance ...

On Thursday, 5 August 2021 at 11:44:01 UTC+5:30 Magnus Therning wrote:

>
> "sharan....@gmail.com" <sharan....@gmail.com> writes:
>
> > Hi,
> >
> > I have a file named README in the repo.
> > The path is /falcon_soc/base/README
> >
> > The remote repo is git@hd1:falcon_soc
> >
> > I have tried several commands to compare but to no avail.
> > Can you let me know the right command to compare 2 files.
> >
> > I have tried the following:
> > git diff master --base/README origin/master --base/README
> > git diff master --falcon_soc/base/README origin/master 
> > --falcon_soc/base/README
> >
> > I have tried several flavors of the above paths
> >
> > I have also tried HEAD:/falcon_soc/base/README 
> > origin/master:/falcon_soc/base/README
> >
> > Nothing has worked so far ...
>
> First things first, you have fetch the upstream changes
>
> git fetch origin
>
> after that it's possible to compare the file in your work area to 
> the file on origin/master like this:
>
> git diff origin/master -- README
>
> /M
>
> --
> Magnus Therning OpenPGP: 0x927912051716CE39
> email: mag...@therning.org
> @mag...@mastodon.technology http://magnus.therning.org/
>
> Computers are useless. They can only give you answers.
> — Pablo Picasso
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/2c142762-7f6d-45a5-94b0-d2ae4dab4567n%40googlegroups.com.

Reply via email to