views:

168

answers:

2

I have a branch that has the content of the master branch as a subdirectory. Now I made some changes to this subdirectory. Ideally I want to be able to merge these changes back into the master branch.

Branch layout:

index.html
subdirectory
  > a.txt
  > b.txt

Master layout

a.txt
b.txt

How would I go about doing this? Is it even a good approach? In SVN I avoided merging subdirectories back into the trunk. But this is a somewhat different use case, the layout of both, the branch and master, will never change.

A: 

You could try

  • making a branch from your current branch (git branch to_be_merge_to_master)
  • moving back your file to the correct structure (git mv ...)
  • merging that second branch to master
VonC
For now this will work. Thanks.
oschrenk
+1  A: 

make use of git submodules

knittl
This seems like the way to go in the long run. In case of the Github project page I would need a separate project to display the application(s). Maybe I move them to my user page.
oschrenk