I've got a fundamental misunderstanding of what's going on here, any help would be great. I switch back to master, try to cherry-pick again (hoping the commit data is available now), but I get the same problem. So now here on my local machine, I can see that the files in the directory reflect zebra's state correctly. Watch this intermediate Git tutorial video to learn when to use the cherry pick command in Git, how to cherry pick a commit, when a merge might be preferred, and to see an example of how cherry picking. So I switched branches: git checkout zebra In Git, the cherry pick command allows you to take changes from a target commit and place them on the HEAD of your currently checked out branch. Since "zebra" is a remote branch, I was thinking I don't have its data locally. You can join the first two steps by just branching off of your waiting branch branch1 instead of master, then there is no need for cherry picking. Does git store something like a database of commits locally in my working directory, for all other branches? When executing the cherry-pick command, does it go and search that local database to find the commit I'm talking about? So the first obvious question is, why can't git find the commit I'm referencing? I don't really understand how this is working in the first place to be honest. In Git, the cherry pick command allows you to take changes from a target commit and place them on the HEAD of your currently checked out branch. Where "xyz" is the signature of the commit I'm interested in, that happened on branch "zebra". Its also possible to cherry-pick multiple commits but merge is the preferred way over cherry-picking. This contrasts with other ways such as merge and rebase which normally apply many commits to another branch. Ok, now I try to cherry-pick the commit I want: git cherry-pick xyz git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry-picking in Git means choosing a commit from one branch and applying it to another. Nothing to commit (working directory clean) I want to cherry-pick in a commit from another branch, named "zebra". On my local machine, I'm currently on my "master" branch. I'm having trouble performing a cherry-pick.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |