I and my teammate are working on the same project on OpenShift. we have several branches which have to be on the server, so we use command push --all
, each of us (I and my teammate) want to have a local branch (called LocalTest
) for our local tests and develop so the problem is when we use push --all
origin branches are made for all of the branches which include LocalTest
.
by the way, I forgot to point that, sometimes we need to merge other branches to our local one especially after pulling their new commits from the server and also want to cherry pick or even merge (rarely) from our local branch to other branches which will be push to server.
is there any command in git like git push --all except branch-name
and what is the best solution for our problem?
One solution would be to have a dedicated local clone in which you have only
LocalTest
.You would make your
push --all
from your current local clone, where you have all your branches.It is a good idea: you can add your first clone as a remote of your second clone (which has the local test branch).
That means you can fetch at any time any branch from the first clone, and merge them to the
LocalTest
branch.Alternatively, You could try and prevent one branch to be pushed (with a pre-push hook, but that would fail the all push --all, which is not practical.