I have two machines, 1
and 2
. Machine 1
is used for the development of code, while 2
is a remote server used for tests and high-performance calculations.
My git repository has two branches, master
and remote-test
.
The following graph shows the current state of the git repository on all machines:
A --- B --- C master
\
`-- D remote-test
Machine 1
always uses the master
-branch, while my remote server (machine 2
) always resides on the remote-test
-branch.
When developing new code, I add new commits to the master
-branch on machine 1
:
A --- B --- C -------- E master
\
`-- D remote-test
I then re-base remote-tests
onto commit E
and force-push the new branch:
A --- B --- C -------- E master
\ \
\ `-- D' remote-test
\
`-- D remote-test (on machine 2 only)
When I connect to my remote server via SSH, I want to pull remote-test
without having the need to handle any merge conflicts etc.
Is there a possibility to use a "force-pull" on machine 2
to override the local copy of the remote-test
-branch?
(I guess, I could always do git fetch; git checkout origin/remote-test
, which puts the head in a detached mode ...)