Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
808 views
in Technique[技术] by (71.8m points)

diff - How to compare a local Git branch with its remote branch

How can I see the diff between a local branch and a remote branch?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
git diff <local branch> <remote>/<remote branch>

For example, git diff main origin/main, or git diff featureA origin/next

Of course to have said remote-tracking branch you need to git fetch first; and you need it to have up-to-date information about branches in the remote repository.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...