1

A --> B --> C

C is a newer commit and A is an older commit.

I currently have A checked out. Is there a way to get the changes from C applied to my current state without getting the changes from B?

Grant Foster
  • 722
  • 2
  • 11
  • 21
  • 2
    That's called a cherry-pick. – melpomene Oct 16 '18 at 20:15
  • 1
    `git help cherry-pick` – Jonathan Wakely Oct 16 '18 at 20:18
  • If C built upon B, this is not likely going to go well for you. You'll have to graft the changes from C into A. Look at git replace, specifically the graft functionality. https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-replace.html – raterus Oct 16 '18 at 20:19
  • 1
    @dev I've voted to close it as a duplicate of [What does cherry-picking a commit with git mean?](https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean). It might be more useful to others to keep it instead of deleting it, so that searching for text like "apply changes from newer commit to older commit" will find this, which will point to the other question. – Jonathan Wakely Oct 16 '18 at 20:21

0 Answers0