Questions tagged [cherry-pick]

In source control management, the act of selectively pulling single changes from peer to peer is called "cherry-pick".

448 questions
2
votes
1 answer

Merging changes from a branch based off a topic branch to a different topic branch in git

My team is working on a shared topic branch in git which I will call "topic1." I was working on a refactor of some code on a branch made off of topic1, which I will call "refactor." I have been periodically merging topic1 into refactor so I can stay…
Eliot
  • 5,450
  • 3
  • 32
  • 30
2
votes
2 answers

Mercurial - `hg graft` with custom destination?

Is there a way to graft a commit onto somewhere other than the current revision? The documentation makes it sound like there isn't: hg graft [OPTION]... [-r REV]... REV... copy commits from a different location And I don't see any parameters that…
Mark
  • 1,746
  • 2
  • 18
  • 19
2
votes
1 answer

What it means "changes introduced by a commit" in git

Everywhere I see this: "...cherry-pick applies changes introduced by a commit..." I did this: created this file in master: ** File 1 ** Content ** Footer ** then branched out to branch2 and committed a change: ** File 1 ** Content Edit 1 **…
2
votes
2 answers

How to cherry-pick with a comment non interactively?

I have a script which cherry-picks a commit while adding more information to the comment. Today I run git cherry-pick and then git commit --amend to modify the commit message. I can see there is the -e flag, but it seems to be interactive. Is there…
mark
  • 59,016
  • 79
  • 296
  • 580
2
votes
1 answer

How to cherry-pick selected set of commits?

I want to select particular set of commits to be cherry-picked to a new branch. main-branch * commit8 * commit7 * commit6 * commit5 * commit4 * commit3 * commit2 * commit1 I just want to create a release-branch with selected…
Gopalki
  • 47
  • 6
2
votes
3 answers

How to use cherry-pick from one Git branch to another?

I am trying to cherry-pick a commit from one branch to another. Consider the below scenario. Branch A -> commit1 -> commit message "12345 Hello World" I want to add a new message at the beginning of the commit message while doing cherry-pick. So…
2
votes
2 answers

Restrict cherry-picks to GIT

We would like our developers to not make cherry-picks at all and follow the our standard branching strategy. We use bitbucket. Is there a simple way to forbid making cherry-picks? Google didn't help there and the only way to do it is to develop a…
Azi
  • 199
  • 1
  • 10
2
votes
1 answer

Git cherry-pick vs merge branches

I understand that cherry-pick was invented for apply some intermediate commits but does exist any difference between: git cherry-pick last_commit_from_branch and git merge some_branch As i understand, git will apply not only this one commit but…
Roman Roman
  • 617
  • 1
  • 9
  • 16
2
votes
1 answer

How to merge the result of a fetch into the master?

I have just done a "cherry picking" by executing git fetch ssh://myname@something1 something2 && git checkout FETCH_HEAD After I execute git branch (to see what branch I am in), I see that I am in a branch with a strange name: (HEAD detached at…
Roman
  • 124,451
  • 167
  • 349
  • 456
2
votes
2 answers

git cherry-pick commits in range where commit message contains string / matches regex?

Background / scenario I have a local work flow where I always commit on a "local" branch (ancestor of "master"), using commit messages beginning with issue number, such as "#123: Some message". I create feature branches which are also ancestors of…
donquixote
  • 4,877
  • 3
  • 31
  • 54
2
votes
1 answer

How to merge a repository copy

At the beginning of the project we started REPO-A. That repo continued for several months until one of the engineers decided to fork the project. Now he did this by just duplicating the directory and starting a new repo. REPO-B. Now B has none of…
Ramon Y
  • 21
  • 1
2
votes
0 answers

GitHub cherry-picking your change from master to release branch

I have GitHub repository with two branches -- master -- release master is where latest code resides. release branch is used to release the particular version of software to customer. Every developer creates a new branch for his feature development…
Kumar
  • 1,536
  • 2
  • 23
  • 33
2
votes
1 answer

Cannot rebase git, merge and Gerrit

I have done something really weird. And I don't know what to do know. I am working with Gerrit, and it just showed me that it cannot merge because of a conflict, but there were no conflicts, but instead I guess it was because of detached HEAD And I…
user7568246
2
votes
2 answers

How to always cherry pick the latest version of a review from gerrit?

Is there a scriptable way to cherry pick the latest version of a gerrit patch review? On Gerrit interface you can easile copy the code for a cherry pick but this code specifies a specific version and I am interested about some bash code that would…
sorin
  • 161,544
  • 178
  • 535
  • 806
2
votes
1 answer

CherryPick: Mainline branch is not specified but b0c4de0c8e164d09efe73a24aec3f9096c860e1f is a merge commit

I am in Visual Studio 2015 "Team Explorer" on my master branch and I am trying to get some bugfixes I accidentally did on the development branch back into the master branch. Someone told me I should cherry-pick them. So I made sure there are no…
Alexander
  • 19,906
  • 19
  • 75
  • 162