I have a branch with actual sources and I did not make any commits for a long time to master, and at the moment it's completely out of date. I want to just replace master's content with the content of my branch. One way to do it is to checkout both branch and master, delete master's content and copy content from branch to master, and after that push result to master.
It works, but I believe there has to be some git command to do it in a simpler way.
Does anybody know how to do it?
In GitHub Desktop, click Current Branch. Click Choose a branch to merge into BRANCH. Click the branch you want to merge into the current branch, then click Merge BRANCH into BRANCH. Note: If there are merge conflicts, GitHub Desktop will warn you above the Merge BRANCH into BRANCH button.
You can use the following command to have master point to a new location:git branch -f master branchToMoveMasterTo
What this is actually doing is creating a new branch called master
that points to branchToMoveMasterTo
. Since we already have a branch called master, we need the -f
flag to say we want to delete the original master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With