Answer the question
In order to leave comments, you need to log in
What is the correct way to work with a branch after git push --force?
During development, we have the following scheme of working with git:
- local copy
- some-devel - developer's working branch on the server
- dev - general development branch
- master - pre-production
for each developer has its own subdomain somedevel.dev.site where its
general branch is auto-deployed the development branch also auto-deploys
. The principle also applies: each task has a branch, after its test it merges into the general
one in its somedevel branch, I often do git push --force to show this or that branch, or different options,
and I pour it into the general development branch already neat commits using git rebase -i HEAD~
The question is how to autodeploy your subdomain to get the current version of the branch, if the branch is often flooded git push --force
If you do git pull, then it tries to merge, which only interferes
Really git fetch; git checkout origin/somedevel ?
Answer the question
In order to leave comments, you need to log in
Is git fetch; git checkout origin/somedevel ?
git fetch && git reset origin somedevel --hard
--force
this is ... not good. Option two:
you shouldn't have auto-deployed from branches, it would be much more convenient to deploy an arbitrary branch with an arbitrary commit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question