Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff files from upstream to local branch #4211

Open
RoadRoller01 opened this issue Jan 24, 2025 · 3 comments
Open

Diff files from upstream to local branch #4211

RoadRoller01 opened this issue Jan 24, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@RoadRoller01
Copy link

its will be useful to just know which files got changed,
especially if there was a lot of small commit.

@RoadRoller01 RoadRoller01 added the enhancement New feature or request label Jan 24, 2025
@RoadRoller01
Copy link
Author

RoadRoller01 commented Jan 24, 2025

In the vanila git i could just run
git fetch
then
git diff master origin/master
or
git diff master origin/master --stat

@stefanhaller
Copy link
Collaborator

The easiest way to do that is to select all commits of your branch as a range selection (using shift-downarrow). This will show you the combined diff of all the selected commits (and you can press enter if you want to see the individual changed files). It may be cumbersome to do when your branch is very long, but for reasonably-sized branches it works quite well, and I do this often.

Note that this is different from running git diff master origin/master in the case that your branch is not quite up to date with its upstream (i.e. if other people have pushed things to master in the meantime), because the diff command would also show you those other changes, which is likely not what you want; the above range select method doesn't have this problem. Obviously this is not an issue when you are working alone on your repo.

Finally, if you really want to do the equivalent of git diff master origin/master then you can do that by selecting master in the branches panel, pressing shift-W, and choosing Diff master@{u}. This will select origin/master as the "from" end of a diff, and diff that against whatever is selected, which is master in that case. Just don't forget to press Escape to get out of this mode when you're done, otherwise it can be very confusing if you move around and see diffs that don't make sense.

@RoadRoller01
Copy link
Author

Note that this is different from running git diff master origin/master in the case that your branch is not quite up to date with its upstream (i.e. if other people have pushed things to master in the meantime), because the diff command would also show you those other changes, which is likely not what you want; the above range select method doesn't have this problem. Obviously this is not an issue when you are working alone on your repo.

Yeah I forgot to say that I must run git fetch before using the command, in case you missed it I edit my comment.

Also special thanks to your fast and self-explanatory reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants