Answer the question
In order to leave comments, you need to log in
How to merge a slave branch into master and replace all content?
Good time to all participants!
Tell the newbie how to merge a secondary (let’s say slave) branch into master so that it replaces all the contents of master with its own, and the data from master is deleted.
For example:
master>
index.php
a.php
b.php
d.php
slave>
index.php (modified)
b.php (modified)
c.php
d.php
output should be:
master>
index.php (modified)
b.php (modified)
c.php
d.php
as if the master branch should be deleted, and then the slave branch is renamed to master and then it becomes the main branch.
Answer the question
In order to leave comments, you need to log in
Tell the newbie how to merge a secondary (let’s say slave) branch into master so that it replaces all the contents of master with its own, and the data from master is deleted.
git checkout slave
git merge -s ours master # смёржить master в slave, оставив только содержимое slave
git checkout master
git merge slave
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question