Comparing the differences between two repos

Rob Faldo
1 min readJul 18, 2022

I was interested in what was actually different about a rails 7 application that uses the default importmaps for javascript compared to a rails application that is started up using esbuild.

After some googling, this is how I did it:

mkdir rails-tests
cd rails-tests
# create both appsrails new default
cd default
git add .
git commit -m 'init'
git remote add origin git@github.com:Robfaldo/default.git
git branch -M main
git push -u origin main
cd ..rails new esbuild -j esbuild
cd esbuild
git add .
git commit -m 'init'
git remote add origin git@github.com:Robfaldo/esbuild.git
git branch -M main
git push -u origin main
# Add the default repo as a remote to the esbuild
git remote add -f b git@github.com:Robfaldo/default.git
git remote update
git diff main remotes/b/main

# Compare the files changed
git diff --name-only main remotes/b/main
# Compare the differences in a file
git diff remotes/b/main file_name.rb

--

--