Integrator workflow, is fetch-forward safe for remote repositories?

I control a git repo using an integrator workflow. In other words, I reach for my colleagues and push them onto the blessed repo.

I would like to keep the commit history linear for most cases, so what is normal to do rebaseinstead mergeof integrating changes? Here is an example:

git fetch coworker
git checkout coworker/master
git rebase master
git checkout master
git merge HEAD@{1}
git push

I am worried about what will happen to remote repositories when they do the following git pull. Will git be able to handle this, or will relay fail coworkerin time pull, now that the commits are in a different order on origin?

Refresh . I initially had an example of reinstalling a colleague branch with master. What I intended was the opposite, to put a "colleague" on top of the master. So I updated this example.

+5
source share
5 answers

You definitely do not want to do what you offer, it re-installs the branch masteron your employee master. Depending on what your colleague was on master, you can often rewind the center one master.

What you can do is vice versa, reinstall your colleague’s master before merging it into a master.

git fetch coworker
git checkout coworker/master
git rebase master
git checkout master
git merge HEAD@{1}
git push

. , . , , , , , , , .

. , , , refetch. , , , .

, . , , . , , , . , , , , . , ( !) "".

+3

git , rebase , - . . !

+1

. , git pull, a git fetch, git merge. Git .

, - git rebase, , , , . , .

, Git, , ( , ).

0

"" ?" ( )

, rebasing , .
-, , , . , " ", : " , ".

"" - , , - :

M0----M1----M2
\
 \
  \
   B1----B2

M0----M1----M2
            \
             \
              \
               B1'---B2'

SHA-1 ( ) , .

0

. , .

Pros

  • .
  • , .
  • . ( ), , . " ".

  • , , "" . , , , . , - dev , .
  • dev , , - .
  • . ( , .) , .
0

All Articles