Reputation: 6849
In this below scenario:
In the remote repo there is a dev
branch, and in my local repo there have a dev
branch too.
I have a requirement, I want to pull the remote_repo dev
to my local repo dev
branch, but only want to last commit, I mean the commit:20190906
.
How to do with that?
Upvotes: 1
Views: 30
Reputation: 1323125
You can use git cherry-pick
:
git checkout dev
git fetch
git cherry-pick origin/dev # last commit only
But you then need to decide what to do with your local branch dev
: do you (force) push it back to origin
? That would override the history of dev
on origin
.
Upvotes: 1