How do I verify my files before pushing them.

I want to push, but I want to see what changes i have before I push. In gitbash, I just need to do this: git diff --stat origin/master.

Is there a way to do this in SourceTree? If not it seems like a major gap.

2 answers

1 accepted

You can already do this in git, because the log supports diffing between 2 arbitrary points in time and the remote branch you're tracking is in the log.

Make sure that you have 'Show Remote Branches' enabled. Then, right-click the remote branch in the sidebar (origin > master) and select 'Diff against current'. What this actually does is multi-select your local branch and the remote branch in the log, which shows the difference between them.

You can actually use Ctrl-Click to arbitrarily select any 2 commits and see the difference between them in the log, 'Diff against current' is just a short cut which is available for most entries in the sidebar.

I can't find where to enable "Show Remote Branches" but I must have it enabled, because this works. I had to choose which remote branch of course.

Thanks!

Just a note: I searched all the menus for this and the help, and was unable to find this. Maybe an opportunity to update the help files.

Hi Michael,

There's already an open feature request for this in JIRA here lined up for 1.6 which means you'll see it in SourceTree this year (assuming you're talking of the Mac version).

Hope that helps

What about on windows?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

434 views 0 1
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you