Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I have forked a branch from a repository in GitHub and committed something specific to me. Now I found the original repository had a good feature which was at HEAD.

I want to merge it only without previous commits. What should I do? I know how to merge all commits:

git branch -b a-good-feature

git pull repository master

git checkout master

git merge a-good-feature

git commit -a

git push

1 Answer

0 votes
by (27.5k points)

Use the following command to apply a single commit by itself to your current branch.

$ git cherry-pick XXXXXXXX

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...