githubteacher / github-for-developers-sept-2015

practice repo for the Sept 29-30 GitHub for Developers class
12 stars 36 forks source link

cherry-pick - what if branch is deleted after merging? #717

Closed kcentofante closed 9 years ago

kcentofante commented 9 years ago

In the example, hotfix was merged. Best practice is to delete the branch.

Can I still use the "hotfix" branch name in the cherry-pick command if the branch was deleted after merge?

jaw6 commented 9 years ago

cherry-pick targets a single commit via it's SHA. If you specific a branch (or tag) instead of a SHA id, git interprets that as if you had typed the SHA for the last commit in that branch.

In this case, if the branch has been deleted, you no longer have that handy pointer, you may need to find the specific SHA you're interested in picking.