OK, I have set up a local git repository on my machine and have checked out a mychanges branch so I can add local changes.
Is there any git way of comparing the files in the git repository with files in a corresponding (but with *many* more files in) tree somewhere else on my system? I.e. I want to diff each file in the git repository with a file in a similar tree.
I think all the git-diff commands just compare different branches within a git repository don't they?
On 10 August 2011 20:44, Chris G cl@isbd.net wrote:
Is there any git way of comparing the files in the git repository with files in a corresponding (but with *many* more files in) tree somewhere else on my system? I.e. I want to diff each file in the git repository with a file in a similar tree.
Cant you just use diff with recursive option to diff your out-of-repository tree with your checked-out-version in your repository? You will get a diff and you can inspect it.
Or you could create a new (temp) branch in your repos, check it out, delete all the files (but not the .git/ directory) (using normal linux commands), copying your other files in, then doing a commit so that all the old files are removed from repos, all new files are added, all changes detected. Then you have 2 branches you could diff and compare with git.
-Srdjan
On Wed, Aug 10, 2011 at 08:55:00PM +0100, Srdjan Todorovic wrote:
On 10 August 2011 20:44, Chris G cl@isbd.net wrote:
Is there any git way of comparing the files in the git repository with files in a corresponding (but with *many* more files in) tree somewhere else on my system? I.e. I want to diff each file in the git repository with a file in a similar tree.
Cant you just use diff with recursive option to diff your out-of-repository tree with your checked-out-version in your repository? You will get a diff and you can inspect it.
Yes, but it will report thousands of files which are 'only in' the out-of-repository tree. I guess I could then pipe that into a further grep to remove those files.....
Actually this is pretty close to what I want:-
diff -qr . /var/www/wiki | grep -v '^Only in'
Or you could create a new (temp) branch in your repos, check it out, delete all the files (but not the .git/ directory) (using normal linux commands), copying your other files in, then doing a commit so that all the old files are removed from repos, all new files are added, all changes detected. Then you have 2 branches you could diff and compare with git.
But again it'll report all the thousands of files that are only in the out-of-repository tree.