0

We use git hubflow. Each tam member have his own feature branch. I need to switch from my branch to another one.

Let's decide I am working in feature/branch_1, and my colleguae in feature/branch_2.

branch_1 contains parent_project and subprogect_1 folders

branch_2 contains parent_project and subprogect_2 folders

How can I get replace all contents of my workcpace ?

when I run

$ git hf feature checkout branch_2

I get

Switched to branch 'feature/branch_2'
Your branch is behind 'feature/branch_1' by 24 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

I can pull, but my subproject_1 is still here.

Is it possible to completely switch from one feture brunch to another without any dependencies between branches ?

1 Answers1

0

Your question is a bit confusing due to your previous action. If you pull (which means merging), of course you will get all the commits on the other branch - which include the subproject_1 folder.

Maybe a look at how branching works in Git could be useful - http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

On another note, do you want to get some changes from feature branch 1 in feature branch 2, but not the ones which include subproject_1 folder? If yes, you can cherry pick the commits that you want, without pulling and merging the branches.

I think it would help to clarify if you explain what are your intentions, and how you plan to achieve this using Git.

** I wanted to just comment, but I do not have enough points. Hope this helps anyway.

scas
  • 221
  • 2
  • 9