Questions tagged [git-cherry]

Git command that lists revisions not merged to upstream (not-pushed commits).

22 questions
11
votes
1 answer

What 'cherry' means in git-cherry?

What is the meaning of the word cherry in git-cherry? Besides the fruit, I've only seem the word in the cherry picking expression (also present in git with git-cherry-pick), that means selectively picking something (right?). Doesn't look like to me…
talles
  • 14,356
  • 8
  • 45
  • 58
5
votes
1 answer

Git: Get list if all commits in the latest push in a branch

I am trying to create an automatic pipeline in gitlab-runner that will apply all the changes in the most recent git push. It is picking up the latest commit in the push (using $CI_COMMIT_SHA variable in gitlab-runner). However, if a push had…
Arnab Pal
  • 51
  • 2
5
votes
2 answers

Git: How to list cherry-picked commits?

How to list commits that were cherry-picked in Git? Let's suppose the following scenario: cp = cherry-pick commit cp1 cp2 master -----o------o------o-----o----o \ / / …
user2620348
  • 309
  • 4
  • 15
3
votes
2 answers

Find files that would be changed by git cherry

According to its man page, git cherry does some testing to determine if a commit should be cherry picked into another branch: The equivalence test is based on the diff, after removing whitespace and line numbers. git-cherry therefore detects when…
Jochen
  • 7,270
  • 5
  • 24
  • 32
3
votes
1 answer

How can I get the *other* commit-id when running "git cherry"?

The "git cherry" command is great for identifying commits that have already been applied upstream, but how can I obtain the exact upstream commit-id's that correspond 1-for-1 to my matching downstream commits? Here's my situation: * 04876f4 (HEAD ->…
G. Sylvie Davies
  • 5,049
  • 3
  • 21
  • 30
3
votes
3 answers

git cherry: How to identify equivalent commit by commit message

In my project there are a stable branch and a dev branch. Commits are cherry-picked from dev branch to stable branch. In order to filter all commits on dev that have not been merged to stable, git cherry -v stable dev looks like a good choice.…
lz96
  • 2,816
  • 2
  • 28
  • 46
3
votes
1 answer

"git cherry" shows an already cherry-picked commit as "ready to be applied"

I've been working on branch align and want to cherry-pick some commits from it to master. I use git cherry to look for candidate commits: C:\Users\me\Documents\repo>git cherry -v master align | head -1 + c2bbb3d99440be7524673702c92ad65e6522d2b1 Made…
Chungzuwalla
  • 1,038
  • 6
  • 17
3
votes
1 answer

Cherry-picked commits have different hashes

Say I do git log branch-A..branch-B, I get a list of commits that are in branch-B but not in branch-A. I can also get a list of commits in branch-A but not in branch-B by reversing the order. Almost every commit into branch-A is cherry-picked into…
GXR
  • 95
  • 2
  • 9
2
votes
1 answer

What is the git-cherry equivalent for a single missing commit?

How do I check if a single commit has already been applied to a specific branch? Using the documentation of git-cherry as an example: $ git log --graph --oneline --decorate --boundary origin/master...topic * 7654321 (origin/master)…
null
  • 404
  • 6
  • 12
2
votes
1 answer

How to list git tags containing commit that was cherry-picked

I'm trying to find out how I can list all the tags that contains a given commit including those that were cherry-picked. For example: I have a commit abcd1234, which has been merged into the master branch. This gives me a merge commit with hash…
aver
  • 555
  • 2
  • 7
  • 21
2
votes
1 answer

git: Output of git cherry does not change after git cherry-pick

I have two remotes in git, namely 'origin' and 'upstream'. origin was forked off upstream at some point, and both have had several commits since the fork. Now I want to bring over many (but not all) of the commits that have occurred on 'upstream' to…
Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
2
votes
2 answers

How do I use git cherry to get committer email?

git cherry is superior to git log for getting the difference between two branches. The problem is that its output is limited. I'm trying to extract the email address (or user) associated with a commit. Here is what I'm doing. git cherry…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
2
votes
1 answer

GIT show all commits from branch missing in master using git cherry and format

I want to use git cherry to show all commits that went to a specific branch but are missing from the master branch and log this using pretty format. I tried this: git cherry master branch_name | grep "^+" | sed 's/^+ //' | xargs -I {} git --no-pager…
RaduM
  • 2,551
  • 3
  • 21
  • 24
2
votes
1 answer

Seeing only the commits not in another branch in TortoiseGit

I am using TortoiseGit 1.8.3.0. I would like to study what changes were done in a given branch. On the command line, I would checkout this branch and launch git cherry -v origin/master, which would give me the list of commits in the current branch…
Xavier Nodet
  • 5,033
  • 2
  • 37
  • 48
1
vote
1 answer

How to detect if a *merge commit* has already been picked in a branch?

With git cherry it is possible to check which commits have been already applied to another branch, typically the upstream. However, this returns only non-merge commits. Also git log --cherry ... excludes merge commits, since it implies …
Narcolessico
  • 1,921
  • 3
  • 19
  • 19
1
2