something
something

Reputation: 90

Copy master branch data into other branch

I have a project with a master branch and a second_branch. The data in the two branches is different and I want to copy the data from the master branch into second_branch and then update second_branch on GitHub. How can I do that?

The status of second_branch is:

This branch is 3 commits ahead, 1 commit behind master

Upvotes: 0

Views: 1034

Answers (1)

Ry-
Ry-

Reputation: 225075

You can use git reset to point a branch to a different commit. So, on second_branch,

git reset --hard master

Then git push -f to update GitHub.

Upvotes: 2

Related Questions