Compare remote repositories

Asked

Viewed 272 times

-2

I have in git a code where my colleagues cloned and sent me pull requests, but I think there’s duplicate code between them.

I added their repositories to my machine and want to compare a file from different repositories.

Example: compare the file Arduino/main/main.ino from the remote repository "so-and-so" with the same file as the remote repository "bertrano".

  • 1

    I suggest downloading a tool like Winmerge and using it to compare the root folders of each clone. You can view the comparison between each file of the subfolders.

  • I don’t use Windows. ( I was trying to differentiate with the command itself git diff and using the commit code I was able to differentiate all the files between them (the commit’s ), unfortunately I could not, not only a file as expected. Solves for now because it had two different files between them, but I will still search a solution as I want, file by file.

  • If you only want to compare files, line by line, I recommend using Meld. A visual diff tool.

1 answer

0


git diff remote1/branch remote2/branch file.rb

Being remote1 and remote2 the name of the remote repositories, and branch the Git branch you want to buy. See the documentation of git-diff.

  • That’s what I did, although this command differentiates all branch files. What I wanted was to compare only one file.

  • @Viniciusdesantana can use git diff path/to/file.rb. See my edit.

  • 1

    Until now I was using the previous way that compares all the files, after the project that originated the question few were the times I needed to compare files (see, we are in March) but I am about to embark on a new group project and I will use this solution, thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.