I have one commit on my Staging
branch I'd like to push over to my master
branch. I am using the Github app for Mac and I don't see a way to do this.
I know how to do this in Terminal.
Learning how to cherry-pick
in the Github app would be nice as I enjoy using it too.
Any suggestions?
In the cherry-pick command's simplest form, you can just use the SHA identifier for the commit you want to integrate into your current HEAD branch. Once you know the commit hash, you can use the cherry-pick command. This will dedicate the specified change to your currently checked-out branch.
Cherry picking involves taking a commit from one git branch and applying it to another branch. Cherry picking lets you apply a commit to a branch without having to merge all your recent commits into that branch.
When picking multiple commits you can run git cherry-pick --continue from the console. I'm not sure if you can do this directly via SourceTree. No, that's only true when you cherry pick a single commit; cherry-pick --continue is what you need to run when you are cherry picking multiple commits.
Cherry-pick using Git commit hash In order to cherry-pick changes, you will need to identify your commit hashes. In order to see the commit hashes for your current branch, simply run the “git log” command with the “–oneline” option in order to make it more readable.
If you want a GUI app to do more advanced commands like cherry-pick, i suggest a free alternative to the official Github app: Sourcetree (preview).
It could take months/years before the official Github app supports advanced commands. (I emailed them about another feature several months ago, and it has yet to be implemented)
Learning how to cherry-pick in the Github app would be nice as I enjoy using it too.
Any suggestions?
A 2021 suggestion: update GitHub Desktop, as it does now (March 2021, 5 years later) have cherry-picking!
GitHub Desktop now supports cherry-picking (GitHub Desktop 2.7)
Cherry-picking is a handy feature for when you would like to copy commits from one branch to another.
What more intuitive way to copy a commit than by simply picking it up, dragging it to your branch, and dropping it there!For example, you start working on a new feature, and several commits into development you identify an existing bug in the underlying architecture.
You create a couple of commits to fix that bug.
Then, you decide that the fix needs to go into production and can’t wait until this feature is finished.
No problem! Just create a release branch and use GitHub Desktop to cherry-pick those commits to your new branch for the hotfix.Drag and dropping commits
Want to cherry-pick a single commit? Just start dragging it.
What about multiple commits? Shift+click the range you would like to copy, and drag away.
There are several goodies that come with cherry-picking:Undo: You cherry-picked a group of commits and immediately realized that you cherry-picked one too many.
That’s not a problem. Just click undo in the success banner to remove those commits, and it puts you back on the branch you started from.
- Conflict resolution: Not all cherry-picks are this easy, and conflicts may arise. The same conflict resolution dialog you’re familiar with from merging and rebasing is available for taking care of merge conflicts.
- Context menu: Not a fan of drag and drop? Just right click on a commit or set of commits, and select the cherry-pick option to open a branch dialog to select your target branch.
As usual with cherry-picking, beware of:
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