Reishi Mitani
Posted on July 21, 2020
Suppose you want to pull one specific commit of Branch AAA into Branch BBB. To do this, first we will have to see the commit logs of AAA.
$ git checkout AAA
$ git log
commit 8edb903383e879561f9ae0e289e55example (HEAD -> features/xxxx-yyyy)
Author: exampleauthor
Date: Tue Jul 21 11:42:11 2020 +0900
some commit message
Make sure to write down the commit id 8edb....
somewhere.
Now we move to branch BBB, and cherry-pick the commit
$ git checkout BBB
$ git cherry-pick 8edb903383e879561f9ae0e289e55example
When you check the logs in branch BBB, you will see that BBB now has the commit that was previously only in AAA!
// in branch BBB
$ git log
commit 8edb903383e879561f9ae0e289e55example (HEAD -> features/xxxx-yyyy)
Author: exampleauthor
Date: Tue Jul 21 11:42:11 2020 +0900
some commit message
💖 💪 🙅 🚩
Reishi Mitani
Posted on July 21, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
docker DOCKER and DOCKER COMPOSE: Run Dependencies Without Installing Them in Your Environment
November 30, 2024