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
4
votes
2 answers

Find the direct ancestors (parents?) of a git commit

Start a new repo and add some commits: #( 03/01/17@10:50am )( tim@tim ):~ mkdir test && cd test && git init Initialised empty Git repository in /home/tim/test/.git/ . #( 03/01/17@11:17am )( tim@tim ):~/test@master✔ touch readme && git add…
Tim
  • 2,134
  • 3
  • 26
  • 40
4
votes
1 answer

Applying same file-rename changes to diverged GIT branches

I've got a project which has a master branch and a stable branch - the branches diverged long time ago. Now I've got a couple commits on the stable branch, which I also want to have on the master branch (a bug fix). I cannot merge, as the branches…
adamw
  • 8,038
  • 4
  • 28
  • 32
4
votes
2 answers

Is it possible to cherry-pick a commit from another repository without cloning the entire repository?

I have very limited bandwidth,so I was wondering if it whether it would be possible to get a commit from another repository without actually cloning it. The two repositories have the same file structure but they do not share history at all. Both of…
Abhishek Ranjan
  • 498
  • 3
  • 17
4
votes
2 answers

How do I share single files between multiple branches in git

I have a repository that contains the software in branch master and its homepage in branch gh-pages. The project contains an examples directory with source files that should be contained in the master branch. The homepage should contain the compiled…
Jakob
  • 3,570
  • 3
  • 36
  • 49
4
votes
0 answers

git cherry-pick configuration

need some help! Have problems with cherry-pick. I create *.sh file with the following sequencing (execute in empty folder!): #!/bin/sh git init echo "init" >> file.txt && git add . && git commit -m "commit init" git checkout -b develop for i…
kirill
  • 109
  • 5
4
votes
1 answer

Git-svn unpicked cherries

Given a repository that was previously in SVN and has now been fully converted to Git (ie. currently accessed via "pure" git and not git svn): Given a mainline branch and a release branch that diverged from mainline prior to the Git conversion: Is…
Miral
  • 12,637
  • 4
  • 53
  • 93
4
votes
1 answer

Git: cherry pick inserts changes from other commits

I've been trying to cherry pick a specific commit from one brach into another. Lets say my history looks like this: A - B - C - D (master) \ X - Y (feature) Now, let's say I want to apply only the changes commit D on master to…
Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287
4
votes
1 answer

Cherrypicking versus Rebasing

The following is a scenario I commonly face: You have a set of commits on master or design, that I want to put on top of production branch. I tend to create a new branch with the base as production cherry-pick these commits on it and merge it to…
lprsd
  • 84,407
  • 47
  • 135
  • 168
4
votes
2 answers

Solve cherry-pick conflicts between diverged branches without committing

Edit: beware, this is a confused question. It starts with some wrong assumptions and figures that out, one edit after the other. I got two branches (master and feature) that diverged. master - C1 - C3 \ feature C2 - C4 - C5 C2…
Kamafeather
  • 8,663
  • 14
  • 69
  • 99
4
votes
1 answer

Git merge with commit via cherry-pick

following scenario: i have multiple branches (master/preview/release). i am developing in master, doing periodic commits. let's call them "experimental" and "fixes". now i want to merge selected fixes-commits to my preview-branch without the…
tienbuiDE
  • 183
  • 4
  • 13
3
votes
2 answers

Git Cherry-Pick

I'm a newbie to git, and I do understand how git cherry-pick works, but here is my problem: Recently, someone in my team, changed the directory structure in master, but not the directory structure in another branch. Now, when I do make changes to my…
Krishna Kumar
  • 33
  • 1
  • 3
3
votes
1 answer

git cherry-pick merge conflict pulling in other commits?

For some reason, it looks like git cherry-pick pulls in other commits when flies have merge conflicts. These go away when we use git mergetool but prevent us from manually editing the merge-conflicted file. Does anyone know why this happens? To…
Alan Krueger
  • 4,701
  • 4
  • 35
  • 48
3
votes
0 answers

How to investigate "inflateInit: out of memory" in git cherry-pick?

Background issue is that at $dayjob I've an automated process performing cherrypicks on a server (basically waits to be modified of branches of interest, cherrypicks them on various targets, and pushes those new branches out), on a pretty large…
Masklinn
  • 34,759
  • 3
  • 38
  • 57
3
votes
2 answers

Merging/Cherry-Picking a range of Commits from Branch A to Branch B

I have the following git history: ...--A--B--C--D---E--I--M--N--O--P <-- Branch-A \ \ / \ F--G--H \ J--K--L <-- Branch-B (HEAD) I want to Merge/Cherry-Pick commits (I .. P) to the branch (Branch-B) I have tried git…
M Aqib Naeem
  • 139
  • 1
  • 8
3
votes
1 answer

Can you cherry-pick a hunk or hunks from within a git commit?

When I do stage commits in my workspace I usually use the -p option to go through each hunk of the changes. I find this useful to confirm my changes and as a check on typos and other silly errors. I usually rebase in my open source development work…
Lucas Roberts
  • 1,252
  • 14
  • 17