I am trying to get a diff between two branches in stash. Specially before sending the pull request, wanted to verify the changes.
have been reading many articles trying to figure out a solution but haven't succeeded yet.
here are the articles I have looked into:
Git diff against a stash Compare and Diff for Branches
Does anyone have a solution?
So there's only one "branch" containing all stashes. The machinery might become more clear in this answer: Is it possible to push a git stash to a remote repository? you can 'deduce' what branch the stash fits onto by doing, e.g. (asking: what branches contain the parent revision for this stash?)
Another way to do this is to right-click on a branch and select the "Diff against current" context menu command (current refers to the branch you are currently working on). This will give you the diff between the head commits of the two branches.
Branch types In Bitbucket, the prefix can be changed for all branches other than development or production. Development branch. Usually the integration branch for feature work and is often the default branch or a named branch. For pull request workflows, the branch where new feature branches are targeted. main.
Currently, the only way to compare branches in Atlassian Stash is to create a pull request first. Otherwise, you can use local git commands to compare arbitrary commits or branches.
This is something we plan to improve in a future release. You can watch for updates here.
Edit: Since Stash 3.0 it is possible to compare branches directly in Stash
Do a git stash list
to get the list of stashes. Then pick the ones you need to diff and use git diff
on those two stashed changes
For example
~/> git stash list
stash@{0}: On XXX: temp1
stash@{1}: On XXX: temp
~/> git diff stash@{0} stash@{1}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With