1

Is there any way to see the changes from the cherry-pick?, I was trying cherry-pick

git cherry-pick commit-hash-1 commit-hash-2

for multiple commits and i got multiple conflicts which i have resolved, but unable to check the difference before pushing it.

I can see the changes once i pushed and check difference between the branches, but i want to see the difference before pushing from the local.

Junaid Rahman
  • 15
  • 1
  • 6
  • Not sure what you mean, [like this](https://stackoverflow.com/a/1801150/7034621) where `/` would refer to base of the branch you're intending to merge your changes to? – orhtej2 May 29 '23 at 10:57
  • Don't forget to give a feedback otherwise nobody will be motivated to answer you again. Welcome to Stackoverflow! – Alexander Nenashev May 29 '23 at 15:29

1 Answers1

1

To see changes in your local branch that are committed but not pushed yet into remote you could use (note that origin is your remote's name):

git diff origin...

But more interesting is to see changes both committed and not (the working tree), that way you could check your work without even committing and fix any problems you find in the code. Note that you can see changes in files added to git only:

git diff-index -p --merge-base origin

To see changes in staged files only you should add --cached:

 git diff-index -p --cached --merge-base origin
Alexander Nenashev
  • 8,775
  • 2
  • 6
  • 17