It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Understanding diff against current ?

I have two branches in source tree - master and branch-1. The current branch is master (in bold text in source tree). I right click on branch-1 and do "diff against current". Does this mean "git diff master branch-1", OR "git diff branch-1 master" ?

I wanted to merge branch-1 into master. But, before merging I want to see the changes which branch-1 would introduce into master. Should I select master as current & then then diff against branch-1 or vice versa ?

As an aside, is there a way to see all the commands which source tree performs in the background ? Thanks.

1 answer

0 votes
Mikael Sandberg Community Leader Oct 18, 2019

The diff against current is the equivalent of git diff master...branch

@Mikael Sandberg- In your answer, you have assumed that master is the current branch, right ?

Mikael Sandberg Community Leader Oct 18, 2019

Sorry, should have added that. My example assumes branch is the current branch.

@Mikael Sandberg- Sorry your previous comment is not clear.
"My example assumes branch is the current branch." Which branch are you talking about after "assumes branch ???..."

The command git diff master...branch will show all changes made in branch that have not yet been merged into master, same as compare against current in Sourcetree assuming branch is your current branch.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,955 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you