Identify differences between two similar projects

Asked

Viewed 351 times

3

I have two projects in PHP: one is a store in Rio, and another is the store in São Paulo. Basically, the SP is at the root, and the Rio is "almost" as a clone of the SP project. Each project is presented in one way, the river one is being loaded in a subfolder river which is loaded into the domain, and the other picks up right from the root of the site. (I did this dynamic, using a linux command, to point the project through a symbolic link:
[user@maquina projeto]/loja-SP/ (master)$ ln -s ../loja-RJ/ rio)

to better illustrate, projects are accessed like this:

/store-RJ/ (master) -> www.lojaxyz.com.br/rio
/store-SP/ (master) -> www.lojaxyz.com.br/

I would like to compare them to see the divergences, to treat an error that is occurring only in the river. But each one is in a different Git repository. I’d like something like this:

fictional example: git /loja-RJ/ diff ../loja-SP/ name-only--

  • 1

    Does it need to be with Git? This looks like work for a diff.

  • 1

    No need, I just want to see the difference between some files of both projects, is it possible, without having to pick up file by file? I use the Phpstorm IDE. And I’m having to review file by file with "Compare With Clipboard". Only it’s a lot of file... besides controllers, classes, overrides, templates, helpers...

  • 1

    I’m seeing now, if this would be the solution.

  • Apparently, the above solution solved my problem.

  • Make a response detailing how the process went. This can help anyone else who has this problem.

2 answers

0


To solve the problem using PHP Storm follow this tutorial, within the project, I clicked CTRL+D, and in the window that opened, I selected the directories of the two projects, placing each side by side, where he compared in the window the same files, which were not in both projects and those that were modified. As it is in the tutorial image: inserir a descrição da imagem aqui

0

If you have two git repositories, in two different locations, and you need to know if there are differences between them, you can run one git diff between the two, to see the differences (if any, of course).

Considering that you have one repositorio_a, and wants to compare it with a repositorio_b, do the following in the repositorio_a:

# Vá até o repositorio_a
cd /home/usuario/repositorio_a

# Adicione o repositorio_b como um remote
git remote add -f b /home/usuario/repositorio_b

# Veja as diferenças
git diff master remotes/b/master

# Quando estiver satisfeito, remova o remote
git remote rm b

Browser other questions tagged

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