Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cherry-pick" in Github App for Mac

Tags:

git

github

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?

like image 908
szier Avatar asked Dec 28 '15 01:12

szier


People also ask

How do I cherry pick a branch in git?

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.

What is cherry pick in Xcode?

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.

How do I use git cherry pick continue?

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.

How do I cherry pick a commit locally?

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.


2 Answers

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)

like image 110
Roy Wang Avatar answered Oct 12 '22 17:10

Roy Wang


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.

Cherry-picking features -- https://github.blog/wp-content/uploads/2021/03/multiple-commits.gif

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:

  • commit duplication
  • missed functional dependencies
like image 36
VonC Avatar answered Oct 12 '22 15:10

VonC