Questions tagged [cherry-pick]
In source control management, the act of selectively pulling single changes from peer to peer is called "cherry-pick".
450
questions
1
vote
1
answer
79
views
Cherry-pick commits from different branches into the master branch
Can we cherry-pick commits from two different branches into a third branch? For suppose I have two branches(develop and master). I created two branches A and B from develop and merged them into the ...
-1
votes
0
answers
28
views
A problem I found with git cherry-pick, which may cause you to lose certain lines
Suppose I have a file like this:
Code block A
Code block B
I cherry pick another commit for the same file which is:
Code block A
Code block C
What I want is for the file to be:
Code block A
Code ...
0
votes
3
answers
52
views
Do you know why this cherry-pick makes code diff?
I made some commit (C and D) in master branch for hotfix.
After this, I cherry pick these commit in develop branch.
I guess, If I make Pull Request (base is master, compare is develop), there is no ...
0
votes
0
answers
36
views
Use git log entries to create release notes, without stumbling into cherry picks
I have "main" and "release" branches.
People actively commit to "main" and once a month we make a new release. Not everything in main should go into the release branch, ...
0
votes
0
answers
311
views
Visual Studio 2022 stuck on cherry pick GIT when nothing to commit
I am using VS 2022 and have done a cherry pick. There is nothing left to resolve and all is up to date and yet it is stuck in cherry pick in progress. Am I missing something?
Also tried running git ...
0
votes
0
answers
56
views
Git cherry-pick is disabled in Visual Studio 2017
We are cherry-picking commits on release branch and came across an issue where cherry-pick option is disabled for one specific commit.
Please see the image below
This problem is only with particular ...
-3
votes
1
answer
63
views
git cherry-pick seems to picks up two commits from a single hash
The below screenshot shows the result of running git cherry-pick <hash> while on branch master.
This operation is picking up two commits instead of a single commit. I don't understand why this ...
0
votes
0
answers
38
views
git cherrypicking with merged commits
I haven't use cherry-picking that much in the past, but I need to use it today. So far the commits are linear so I got no problem
But what happen in the following situation
I want to cherry pick all ...
1
vote
1
answer
53
views
Can git cherry picking last commit from throw-away branch damage the history in branch where data will be moved to?
I've read about the unwanted side effects of cherry picking in regards to git history and ability to merge. However all examples I've come across assume that the branch, where a commit is cherry ...
0
votes
2
answers
77
views
How can git log --cherry-pick be parallelized?
I've inherited some code that is using git log --no-merges --right-only --cherry-pick --since='2 months ago' some_tag..origin/master -- path1, path2, ... as an initial step in determining commits that ...
1
vote
0
answers
44
views
Is there any way to see which commit is cherry-picked to a commit?
Assume that there are two branch develop and master.
They are like this (alphabets are commits), master was created based on develop at B:
A — B — C — D (develop)
A — B — E — F — (C cherry-picked) — G ...
1
vote
2
answers
213
views
Can I use rebase to update my feature branch to avoid polluting my commits even if the pull request may go stale?
I have a Develop branch that is actively getting committed to a lot. Before I start my work I like to create a feature branch off of Develop. However, before I submit a pull request for it, I like to ...
0
votes
4
answers
185
views
Git : merge part of changes from branch
We have been working on a work branch for some time now, with the intention of bringing it back to my main branch at some point.
In the mean time, that work branch has been kept up-to-date by frequent ...
0
votes
2
answers
47
views
How can I make a git commit that represents the diff between two other commits?
I'm currently working on a git branch based off of branch main with a HEAD of commit A. I realized I wanted to split the work I was doing into two PRs, but I want to preserve the history properly. An ...
1
vote
0
answers
114
views
After Cherry Pick in Azure DevOps, source branch still showing merged changes
We have dev, release, and master branches. On the Dev branch, we have 10 Pull requests and I want to merge only 5 pull requests from Dev to the release branch, so I used cherry-pick option and merged ...
0
votes
1
answer
59
views
How cherry-pick from one branch to another branch without checkout on this branch
I have 3 branches. dev, master, master_copy. Now I am on the master branch and a need cherry-pick commit from dev branch to master_copy WITHOUT checkout to master_copy or dev branch. How I can do ...
0
votes
0
answers
38
views
GIT Behind/Ahead Counter as a way to track deployed features
I am working on a project, and we have many people working on it. We have 2 branches:
main
develop
When someone gets a task, they make a new branch for their task derived from develop and once they ...
0
votes
1
answer
136
views
Is it possible to cherry-pick a git commit without changing it?
Situation:
I have a repository with commits up to 1234
Someone forks it and adds a commit abcd and sends a PR
I like to rebase it instead of merge the branch as the branches are not diverged
I git ...
0
votes
1
answer
52
views
How to bring commits form another repository branch
So I want to bring only commits from another repository branch to my local branch. How can I do that or can i do that using cherry-pick?
So i tried merging two branches but it brought unrelated ...
5
votes
1
answer
384
views
Check if a commit in a branch was cherry-picked into master
Let's suppose that we have two branches: master and feature_branch.
Is there a possibility to check if each commit to the feature_branch was cherry-picked into master?
-1
votes
1
answer
247
views
GIT Cherry–Picking Commits Out Of Order
I have 1 file
I modify code on one part of the file and do commit A
I modify code on another part of the file and do commit B
If I cherry–pick Commit B from source to release first, and then Commit A ...
0
votes
1
answer
63
views
Merge all commits from a branch to another
At some point in our project we started a new development environment in which, in order to run properly, we were forced to make many changes in our code. Those changes are in a branch named "dev-...
0
votes
1
answer
28
views
Undo or revert a single, earlier GitLab cherry-pick commit?
I committed like 10 individual cherry-picked changes to my new release branch, and now after regression testing found that one of those commits in the middle may have broken something. I am prepared ...
1
vote
1
answer
4k
views
Encountered conflicts when cherry-picking commit . This operation needs to be performed locally error in Azure DevOps
I need to merge changes from one branch (this branch originated from the demo branch) let's say feature1FromDemo to another branch (beta).
There is a difference in the source code of the beta and demo ...
1
vote
1
answer
220
views
What should I do when I’m working on my branch and some push changes on mainline
it was the work flow,
Created my branch using checkout.
Commit my changes on my branch 5 days ago.
Edit some of it on same branch and commit (not merged, on review). Found that there is version set ...
0
votes
1
answer
21
views
How to cherry-pick changes to content extraced into a separate file to a version before the extraction?
Suppose I have in the past split out a smaller file from a larger one. The larger one is still in place:
large.txt --> large.txt
\-> excerpt.txt
Now, I've made a change to ...
0
votes
0
answers
58
views
github branch comparison show difference which are non-existing after cherry-pick
There are two branches A, B, C. A was first merged into C. Then Using github desktop, I "cherry-pick" a few commits from A to B.
However, on github website, using branch comparison on A and ...
1
vote
2
answers
193
views
How can I track a subset of files from a remote repository?
I'm trying to solve the following situation: I'd like to include a (not owned, public) project into mine, resizing a little bit the original file tree by removing redundant and/or not-needed files, ...
0
votes
1
answer
59
views
Remove two adjacent commits from history that cancel each other out. Why is this not simple?
I have history like that:
A <- B <- C <- D <- F
where F is newest.
B and C cancel each other out (really its 3 commits: merge feature to master, revert the merge commit, merge pr ...
0
votes
2
answers
1k
views
How to grab a commit from another branch without a merge?
At face value, this seems like a textbook use case for cherry pick. Googling around, I find statements like:
Cherry picking in Git means to choose a commit from one branch and apply it onto another.
...
0
votes
2
answers
39
views
Cherry-pick is not happening , shows the fatal :not a git repository how do I solve this
I want the latest changes from gerrit and need to pick the changes to putty. How can I pick Changes from gerrit to putty.
0
votes
0
answers
132
views
Cherry-pick multiple commits in smartGit but only first few commits are shown in the result of the target branch
I am using smartGit as the tool, say, I checked out branch A and need to bring some commits in branch B to branch A and those commits are not adjacent and could be spread apart in time of commits in ...
0
votes
1
answer
498
views
In git, why do I have a conflict when cherry picking only latest commit of binary file?
Setup: I have a main branch where a binary file has been modified multiple times. Every commit that changed the binary file only had that one file in the commit (no other files were changed in any of ...
0
votes
1
answer
52
views
Handling pull-requests across parallel forks sharing a parent
I have the following situation (repo had no activity in the last year):
repo _
|
|_ Fork_1
|_ Fork_2 ... commit_4 ... commit_5 ... commit_6
|
|_ Fork_my ... ...
-2
votes
1
answer
68
views
Official documentation describing the base used in the cherry-pick command
This answer to a previous question on StackOverflow suggests the base used for the cherry-pick command is the parent of the commit to be cherry-picked. It makes a lot of sense to me, but I wanted to ...
0
votes
1
answer
49
views
Git: how take modifications introduced by a bunch of commits into the branch without committing?
I have a range of commits of another whose modifications I would like to import in my current branch without creating the commit.
I have seen that the cherry-pick command has the option -n to avoid ...
-1
votes
1
answer
839
views
How to make git cherry pick use fast forward technique
By using git cherry-pick, I've been trying to specifically merge the last commit from one branch to another. But it always results in a merge conflict, when it actually shouldn't. Following is what I'...
1
vote
3
answers
267
views
How to merge/cherry-pick a single commit
I've got a project (GitHub-based) with a branch structure like so
master: A - B - C - D
\
release: W - X - M
/
bugfix: Y - Z
Thus once bugfix is merged, ...
1
vote
1
answer
1k
views
Azure DevOps - Cherry-Picking Into master branch
I have a scenario where I will sometimes need to cherry-pick some commits from our UAT branch into our MASTER branch. This is because the business sometimes will request that only specific "...
0
votes
1
answer
68
views
Force TailwindCSS cherry picking of classes to pick up certain classes
I'm currently using TailwindCSS in my Vue (with Vite) project and I want to use a dynamic width class depending on the size of a certain array.
const array = [1, 2, 3];
const width = computed(() => ...
1
vote
1
answer
36
views
git mess -- how to unscramble cherry picked branches
I have inherited a repo with five or six branches that are not merged into master, and I have to figure out what is in them. I have been using SourceTree to get a graphical view of the branching ...
-1
votes
1
answer
3k
views
Cherry pick specific commits from development branch to production branch
I have two branches in the GIT GUI - Development and Production. When code is pushed onto development, in the CLI, I do git pull and then git merge and git push on the production branch.
If I have 3 ...
2
votes
1
answer
159
views
Cherry-pick binary merge conflict with text files
When I cherry-pick from another repo I often get binary-conflict like this:
`$ git cherry-pick -e 75fa3f
Performing inexact rename detection: 97% (636400/652525), done.
warning: Cannot merge binary ...
2
votes
1
answer
127
views
Command executed via pexpect not taking effect
I am trying to cherry-pick gerrit reviews using a python script. I already have the string required to cherry-pick a review. I have used pexpect to automate the password input step.
Here is an example....
0
votes
1
answer
3k
views
cherry pick multiple commits as one without going through each one git apply patch
I have branch A with a few commits I need to cherry-pick into branch B.
In the first cherry-picks I've added code that I've later removed in the last commits.
When I try to cherry pick them using ...
0
votes
1
answer
89
views
Is there a way to select changes at a patch level in git's cherry-pick?
I would like to be able to select which changes to include in the cherry-pick at a patch-level much like the -p option when adding changes to commit?
2
votes
1
answer
2k
views
The previous cherry-pick is now empty when not cherry-picking
I am trying to drop a list of commits by using git rebase -i HEAD~19. I have successfully used this method in the past, but when I try running and then quitting vim without any changes(:q!) I get this ...
1
vote
2
answers
2k
views
git cherry-pick says nothing to commit
(note: this is not a duplicate question, see explanation below)
I first checkout master as a detached branch:
% git checkout --detach master
HEAD is now at fff9e1e687 modserver/go: skip Spotlight ...
0
votes
0
answers
191
views
What's the best way to selectively share changes between two Git repositories?
We have a Git repository (in Azure DevOps) containing code for a library which is going to be refactored heavily in certain areas. However, some areas of the code will remain (almost) unchanged. As ...
0
votes
0
answers
154
views
git cherry-pick/merge without whitespace changes (but without conflicts)
I'm trying to do a simple thing:
git cherry-pick --no-commit <commit with a lot of useless whitespace changes> -Xignore-all-space
Perhaps I'm overlooking something obvious but I can't force git ...