1

Suppose there are 2 projects in the master branch:

  • Project A
  • Project B

Now I have created a branch from master called develop, which has one project of the master branch: Project A

If someone has changed files in ProjectA in master branch, how can I pull those into develop branch?
I don't want ProjectB in develop branch.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
NKZ
  • 9
  • 4

1 Answers1

0

You would need to use git subtree split in order to isolate projectA folder from master into its own branch.
Then you can merge that branch into develop.

See "How do I merge a sub directory in Git?" for a concrete example of git subtree split.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I did following steps : a) git checkout master b) git pull c) git checkout develop d) git merge master e) git push origin develop This added Project A and Project B into develop. Is there anyway i can delete Project B from develop and merge it to master – NKZ Mar 14 '21 at 03:16
  • @NKZ You can redo those steps, this time using git subtree split to isolate projectA in its own branch, before merging to develop. Or you can simply `git rm -r projectB` in develop in your current state. – VonC Mar 14 '21 at 03:34