GIT re-merging files from dev to master

My GIT master has branching seams to have some errors, so I would like to double-check, re-merge or possibly clone my dev branch over the main branch, so the main branch will be a copy of dev.

How can i do this? thank.

+3
source share
3 answers

If the problem is that your shutter speed files do not match the branch, just use git resetusually:

git reset --hard HEAD

That should be all you need. However, if you still want to overwrite master with dev, read on.


dev, git reset :

$ git checkout master
$ git reset --hard dev

, - :

$ git push origin master

, dev (, , , , - - ), --force :

$ git push origin master --force

, , a la git rebase - - , .


, , --force . git push, git pull , git push.

+6

, :

  • .
  • .
  • .

-, . :

1 git reset --hard HEAD, .

2 .

3 git reset --hard dev, , . , git reset --hard SOME_COMMIT_ID_THAT_ISN'T_BROKEN

--force, , .

, - (.. ). -, , , . git init --bare .

? . .

+1
. , . , . . , , .
git checkout master

git pull origin dev

git commit -a -m "reverted to dev"

, , .

0

Source: https://habr.com/ru/post/1781352/


All Articles