I want to reflect the local branch to the Github remote master

Asked 2 years ago, Updated 2 years ago, 137 views

How can I reflect the latest version of commit 14450f3 of the local branch feat/map to the remote master?

Enter a description of the image here

git github

2022-09-30 21:33

1 Answers

You can apply only certain commits to git in a way called cherry-pick.
https://rfs.jp/server/git/gite-lab/git-cherry-pick.html

Therefore, the flow is to create a new branch from the master, create a branch with a specific commit, and merge it.

Specifically, I think it will be as follows.

# Switch to master branch
$ git checkout master 

# Create a feature branch to run cherry-pick from the master branch
$ git branch hotfix-cherry-pick

# Switch to the created feature-branch
$ git checkout hotfix-cherry-pick

# Run cherry-pick
$ git cherry-pick 14450f3 
# There may be a collision at this time.In that case, treat it the same way as a normal conflict.

This will create a branch with a specific commit applied to it, so
The rest will be pushed remotely like a regular branch and merge into the flow.


2022-09-30 21:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.