Scenario: While working on a task/feature, you fixed a small bug in an unrelated area of one of the files you changed. At commit, you'd like to commit that separately.
Tried staging the hunk I wanted to commit,
- There is no option to commit what is staged,
Tried staging what I didn't want to commit,
- Everything I'd staged also appeared in the commit anyway,
Tried discarding what I didn't want to commit,
- Actually removed/reverted the change from the source file.
So what is the intended workflow for cherry picking a subset of changes and commiting just them? Am I missing something obvious?
Hi, Kieran, Sorry for the delayed reply - it was for Windows but the pathalogical behavior went away and the workflow is now actually pretty nice -- one simply selects "Commit" from the button bar or on the "Uncomitted changes" view and then "stage hunk" or "stage selected lines", which automatically takes you into "Staged changes" view mode, and in that mode you can cherry pick hunks or individual lines to commit.
The only disadvantage to this right now is that when you "stage file" the view refreshes and resets the selected file to the top file in the list.
Lets say you just removed a #include from include/pch.h and you want to commit adding the include to the src/*.cpp files. This gets annoying, fast, because every time you "stage file" from a src file, it resets the current file to h/pch.h.
Thanks very much for the insight. This sounds to me like you'd like it to behave in a different manner. If so, could you possible file a new issue on jira.atlassian.com (project SRCTREEWIN) with as much detail as possible? Feature requests go there usually and they're reviewed periodically with feedback given and hopefully assigned to an issue.
Thanks very much
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