If I create a branch in Git, is it ok to merge the parent branch back into my working branch? -
if create branch in git, ok merge parent branch working branch, in order collect changes other people have checked in?
let's start master
, feature
branch.
if have feature
checked out , create new branch:
feature> git checkout -b morefeaturework
then, if commit changes , merge work feature:
morefeaturework> git commit -a -m "commit changes" feature> git merge --no-ff morefeaturework
then, lets needed more week on branch next week. let sit week , in meantime, lots of other people have merged work feature
.
is ok , update branch latest changes?
morefeaturework> git merge feature
or, problematic?
as understand, didn't modify morefeaturework
branch? want 'up date' before start working?
if goes , people added stuff on top of feature
branch, suggested merge should fast-forward , keep morefeaturework
date.
personally however, prefer morefeaturework> git rebase feature
way, can potentially update morefeaturework
branch when have done changes on it.
note: assuming morefeaturework
branch merged feature
before, of course delete branch , create new branch.
feature> git branch -d morefeaturework feature> git checkout -b morefeaturework2
branch or that.
Comments
Post a Comment