1

Hie I am working around in git to achieve something like mentioned below.

Imagine there is a Big feature which is going to develop - since it's very big they have split into core feature and an extended feature.

Now they have divided into teams for development.

Now how to make branches in a below-mentioned way

the core will be developing in core_branch extended will be developing in extended_branch containing core develpment it should be like that when we perform git pull in extended_branch it has to pull if any commits made to core_branch how to achieve this??

I am aware of git rebase / git merge. In either of the cases, extended team/developers have to check any new commits in the core branch and merge/rebase their extended_branch

Akhil Surapuram
  • 654
  • 1
  • 8
  • 22

1 Answers1

0

Here's one way to do it:

(1) Set up the core_branch.

git checkout -b core_branch

You can develop and push to core_branch as normal

(2) Check out a branch for extended_branch based off of core_branch.

git checkout -b extended_branch # be sure to do this while on core_branch

(3) When on extended_branch, if you want to pull in changes from core_branch, then do the following

git fetch origin core_branch
git rebase -i core_branch # do this while on extended_branch

After this step, all the commits to core_branch will be on extended_branch.

Vikas Yendluri
  • 341
  • 3
  • 7
  • 13
  • My answer is also expressed in https://stackoverflow.com/questions/14893399/rebase-feature-branch-onto-another-feature-branch – Vikas Yendluri Mar 14 '19 at 20:20
  • here you are manually checking every time core_branch is updated. the point is you won't be knowing when core branch gets updated – Akhil Surapuram Mar 15 '19 at 07:49
  • i don't believe there's a way to get an automatic update. Just as you need to pull master manually, you'll need to pull/rebase off core_branch manually – Vikas Yendluri Mar 15 '19 at 17:57