Answer the question
In order to leave comments, you need to log in
Is it possible somehow to completely rewrite a branch with another one from a remote repository with one command?
For example, I'm on the dev branch. And I want to pull the master branch, but so that I have a clean master, without any changes in dev. Through git pull it doesn’t fit, because then it will merge, but I don’t want to merge. Is it possible to do something like this in one fell swoop, without deleting locally, globally, etc.?
Answer the question
In order to leave comments, you need to log in
git fetch
will first help you get all the branches from the external - then check out as much as you need.
git checkout master
so as not to spoil the master - in general, I recommend making a new branch from the master and merging into this branch - if the merge has not entered, then it is easy to roll back to a clean master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question