In some branch I made some changes, but didn't add them to the index.
Next I checked out a new branch to track a remote one and saw that the changes made while working on the first branch where still there. I would have expected them being discarded because now the local branch doesn't reflect the state of the remote branch.
Ok, but the problem is SourceTree has no option in de Checkout New Branch tab to discard/cleanup changes.
Git won't discard uncommitted files unless you explicitly tell it to. If the files that you changed are identical between the two branches (besides the uncommitted changes), Git will allow you to switch while keeping the changes (useful if you realized you were making the changes on the wrong branch, or just created a new branch for changes you were creating).
New files will always be kept as well, and Git should only complain if you try to check out a branch that has an indexed file with the same name/location.
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot