Skip to main content

I’m attempting to determine the changed files between two different branches and what I’ve found is an anomaly that I can’t recreate on the git on Windows.

The scenario:

  1. Create a repository - branch master
  2. add some files, git add/commit
  3. Create a new branch - B1
  4. add a file, change an existing
  5. git add/commit
  6. git diff --name-status master…B1
  7. works great as does the reverse
  8. Create a new branch from B1 -> B2
  9. add/remove/change files
  10. git add/commit
  11. git diff --name-status B2…master
  12. the results that I’m seeing are the diff for B1 and B2 but NOT B2 and master.

Is this a known issue? Thoughts/suggestions?

Is there a better way to get the list of files changed (add/rename/delete/update) between two branches?

I’m attempting to determine the changed files between two different branches and what I’ve found is an anomaly that I can’t recreate on the git on Windows.

The scenario:

  1. Create a repository - branch master
  2. add some files, git add/commit
  3. Create a new branch - B1
  4. add a file, change an existing
  5. git add/commit
  6. git diff --name-status master…B1
  7. works great as does the reverse
  8. Create a new branch from B1 -> B2
  9. add/remove/change files
  10. git add/commit
  11. git diff --name-status B2…master
  12. the results that I’m seeing are the diff for B1 and B2 but NOT B2 and master.

Is this a known issue? Thoughts/suggestions?

Is there a better way to get the list of files changed (add/rename/delete/update) between two branches?

Hello lbdyck,

Can you please give more detailed scenario, I can’t reproduce your problem with the following scenario:

mkdir 1
cd 1
git init
echo test > test
git add test
git commit -m “c1”
git branch B1
git checkout B1
echo test2 > test2
echo test_upd > test
git add .
git commit -m “c2”
git diff --name-status master…B1
git branch B2
git checkout B2
rm -f test2
echo test3 > test3
echo test_newupd > test
git add .
git commit -m “c3”
git diff --name-status B2…master

Having the same behaviour on the git on Windows and USS

Thanks,
Alexander


I’m attempting to determine the changed files between two different branches and what I’ve found is an anomaly that I can’t recreate on the git on Windows.

The scenario:

  1. Create a repository - branch master
  2. add some files, git add/commit
  3. Create a new branch - B1
  4. add a file, change an existing
  5. git add/commit
  6. git diff --name-status master…B1
  7. works great as does the reverse
  8. Create a new branch from B1 -> B2
  9. add/remove/change files
  10. git add/commit
  11. git diff --name-status B2…master
  12. the results that I’m seeing are the diff for B1 and B2 but NOT B2 and master.

Is this a known issue? Thoughts/suggestions?

Is there a better way to get the list of files changed (add/rename/delete/update) between two branches?

Ignore the problem was found between the keyboard and the chair.

sorry to trouble you