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
0
votes
1 answer

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?
feeling_lonely
  • 6,665
  • 4
  • 27
  • 53
0
votes
0 answers

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 part of the changes, the library will get a new…
gehho
  • 9,049
  • 3
  • 45
  • 59
0
votes
0 answers

git cherry-pick/merge without whitespace changes (but without conflicts)

I'm trying to do a simple thing: git cherry-pick --no-commit -Xignore-all-space Perhaps I'm overlooking something obvious but I can't force git into ignoring any whitespace change from the given…
Miro Kropacek
  • 2,742
  • 4
  • 26
  • 41
0
votes
1 answer

git cherry-pick a commit, the commit updated later, how to get latest

I cherry-pick a commit from another person's branch. Later the user updated his commit(maybe by squash), so the commit SHA changed. How do I cherry-pick to get latest commit?
sli
  • 1
  • 2
0
votes
1 answer

Git cherry-pick picking all commits

Let's say we have a branch called Master and another branch called Dev which is based on Master. We have created several branches out of Dev for different features and it all got merged into Dev. Then we merged Dev into Master , so now they are…
Alvaro
  • 51
  • 5
0
votes
1 answer

why git cherry pick adds changes not included in the commit (but included in the source branch)

I am trying to cherry pick a commit from src-branch to dst-branch. for example I have a commit that changes file1.txt: file1.txt in src-branch before commit: hello world! goodbye world! file1.txt in src-branch after commit: hello world! goodbye…
Noy Gafni
  • 1,091
  • 9
  • 19
0
votes
0 answers

Git diff issue with cherry picked commits

I am seeing an error in our release build process. Need your help/suggestions on it. In our organization, we follow the release strategy like this: our codebase has microservices/applications located on individual folders like this…
0
votes
3 answers

What use case is git cherry-pick useful for?

Originally, I thought git cherry-pick does a diff on its parent, produces a patch file and then applies that patch onto your HEAD, which I think is far more interesting and unique and I haven't seen in a git command that does this yet. Such a…
LeanMan
  • 474
  • 1
  • 4
  • 18
0
votes
4 answers

Using Git and Github, how to omit some commit(s) in master?

Let's say, We made commit #100 to master. We want to make commit #101 in a branch go to master However, since there is potentially some issue with commit #100, so we want to go to commit #99 and then cherry-pick #101 and make a PR But we found the…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
2 answers

How to pull specific commit from remote repo

I have 2 repos in my local project: 1. remote # this is my working area, where I want to push a commit from side_repo 2. side_repo # this is remote repo, where I want to pull the commit from I read the question, and try to repeat the…
Sergo
  • 21
  • 5
0
votes
1 answer

Does history diverge in git if I use cherry picks or manually edit files?

I have a development branch called main, a staging branch called staging and production branch called production. I want to push a hotfix to production branch. First I created a new branch off main: git checkout main git checkout -b hotfix Then I…
hitchhiker
  • 1,099
  • 5
  • 19
  • 44
0
votes
2 answers

Git cherry pick into a new subdirectory

I often have to git cherry-pick from an old project to a new project. The new project hosts all files in a /server/ subdirectory. This throws off all the cherry-picks as it thinks the files should be, e.g. /path/to/project/myfile.php rather than…
0
votes
0 answers

Is it possible to cherry pick commits from a repository with different path?

I have 2 repositories: a starter theme repository and a repository for a whole WordPress website. At the beginning of development, I copied the starter theme to the /web/app/themes/themename in project repository. Then I started developing the…
Jaska
  • 111
  • 1
  • 2
  • 6
0
votes
0 answers

Git cherry-pick command is not working while adding the code from one branch to another

I have 3 branches dev, backup, and release. backup was created from dev, the release was created from backup. Now I have new changes in dev. only one commit should go in the release branch. so I am trying to use cherry-pick from dev to backup and…
stackUser
  • 545
  • 3
  • 9
  • 21
0
votes
1 answer

Python Script for Local Repository and Cherry-Pick for specific commit GIT

I want to create a python script for making local repository and I have no idea how to do this, after local repository I want to do cherry-pick for specific commit. Any tips for me ?