3

I have taken over a project where files on a server are not in a git repository. A git repository was created at some point, but files were still edited on the server without being added to the repository and tracked. Is there a way that I can perform a git diff on the server files against a git repository to see how far off I am?

Mouloud85
  • 3,826
  • 5
  • 22
  • 42
  • Copy the files from server to local git repository and do git diff. – Mohit Sharma Jan 28 '16 at 05:37
  • 1
    check this answer: http://stackoverflow.com/a/17194704/4036946 (`git diff --no-index f0 f1`) – jsxqf Jan 28 '16 at 05:44
  • If git is installed on the server `git diff --cached . // will show changes between staged and last commit` `git diff . // will show all staged but modified in working directory`. also add --stat switch to see summary of files – Bunti Jan 28 '16 at 05:47
  • Can --no-index have one of the files be a remote repository or branch? – Nate Biondi Jan 28 '16 at 06:51

1 Answers1

-1

Did you try using vimdiff instead of git diff?

You can compare any two files using vimdiff, it'll open both files next to each other, and highlight the changes.

vimdiff <path_to_file1> <path_to_file2>

Loukan ElKadi
  • 2,687
  • 1
  • 16
  • 20