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
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
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...
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