How do I show changes that have been made to the develop branch since the last rebase of my feature branch?

StackOverflow https://stackoverflow.com/questions/7192827

  •  12-01-2021
  •  | 
  •  

Pergunta

Using the git flow model, I've got a feature branch that was split from the develop branch at some point in the past. While I'm working on my feature branch, other developers commit to the develop branch. As a result, I'll occasionally perform a rebase to pull these changes into my feature branch.

My question is, how can I get a diff of changes that have been made to the develop branch since the last time I rebased? I.e., "Is my feature branch up to date with the develop branch, and if not, what am I missing?" or perhaps, "If I do a rebase now, what will I get?"

Here's what I've got so far:

Find the commit where we branched:

git merge-base feature/my_feature develop

Find the diff between that commit and develop's HEAD:

git diff <id from above> develop

I can easily merge these into a single command:

git diff $(git merge-base feature/mybuys develop) develop

But that seems rather roundabout. Is there a better way to do this in one shot?

Foi útil?

Solução

This is what the triple dots are for:

git diff feature/mybuys...develop
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top