version control - Is git rebase recommended while multiple developers working on same branch? -
version control - Is git rebase recommended while multiple developers working on same branch? -
in http://git-scm.com/book/en/git-branching-rebasing#the-perils-of-rebasing
it recommened rebasing should not done when repository public.
and recent post in git merge vs rebasing
recommends rebase should not done on branch shared between developers.
i understand that, because developer might first merge code , decides rebase code, other developers might endup in creating multiple duplicate commits explained in perils of rebasing.
what if developers comes on mutual understanding going rebase code instead of merging? recommendation still apply?
p.s
all these answers confuse me. thick reframe question again.
lets assume there 2 developer working on 2 different computers. there central repository. 2 developers cloned , started working.
developer 1:
created branch local/master. lets local/iss123. pushed remotedeveloper 2:
pulled changes remote checksout local/iss123 made commits in local/iss123 pushed changes remote/iss123developer 1:
has local commits he wants rebase branch origin/iss123 git rebase origin/iss123 then pushes commits origin/iss123developer 2:
has local commits he rebase branch origin/iss123 git rebase origin/iss123and on. developer 1 & 2 rebase branch origin/branch pushes changes origin/branch
after functionality stable,
developer 1:
checkouts local/master pulls latest code origin/master checks whether there commits in local/master other developers will checkout local/iss123 will rebase local/iss123 local/master if there new commits. then pushes branch local/iss123 remote/iss123 if there rebase done. then checksout local/master merges local/iss123 local/master then pushes local/master origin/masterdeveloper 2:
will pull latest changes origin/master , origin/iss123 local/master , local/iss123 respectivelylater cycle continues again.
is correct? right way when 2 developers working on same branch , want rebase instead of merging?
once code force public repository, no alter should happen commits. when rebasing on local repository pushing find. example: create changes on feature branch. pull parent branch of feature branch, develop branch. can rebase feature branch on develop. can force develop branch origin.
so if developers rebasing on local repos rebase force ok.
the main point 1 time commit or branch has been shared on public repo, no 1 can alter rebase or amend comment, etc.
git version-control
Comments
Post a Comment