0

I would like to be able to tell if a particular file which I have in my local git branch, has been updated on the remote branch since my last update.

Is there something I can do on the command line to see if this file has been changed?

mattman88
  • 475
  • 1
  • 8
  • 22
  • 2
    A good answer to a very similar (identical?) question is here: http://stackoverflow.com/a/19558846/758446 – BlackVegetable Oct 20 '15 at 20:59
  • Thanks for that, in my case I need to see if a particular file has changed on the remote, not whether the remote branch has changed at all. Do you know of a way I could find out which files changed? – mattman88 Oct 20 '15 at 21:08
  • 1
    The answer BlackVegetable pointed you at was has accepted solution "git fetch origin" then "git diff origin/master". The diff would include your file if it has changed. That would be equivalent to an svn diff if you were using svn. I don't understand your problem with that solution. – Sammy Oct 20 '15 at 21:18
  • @Sammy So when I do "git diff origin/master" it gives me an error that says "fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree." am I not supposed to literally put "origin/master" there, I'm pretty new when it comes to git. Thanks for your help. – mattman88 Oct 20 '15 at 21:23
  • 2
    The branch you are comparing two goes in the latter half of that string. So if the branch you are comparing to is named "foo" you would try `git fetch origin && git diff origin/foo`. – BlackVegetable Oct 20 '15 at 21:58
  • @BlackVegetable Thank you, that is exactly what I needed to know. Thanks for putting up with my ignorance to git! – mattman88 Oct 20 '15 at 22:27
  • 1
    I'm going to vote to close this question as a duplicate. I don't mean any offense to you at all of course. I just want people in a similar situation to be directed toward that answer that basically resolved your question. I'm glad to help. – BlackVegetable Oct 20 '15 at 22:41

0 Answers0