tags:

views:

40

answers:

2

I have a git repository in a directory a/b/, and I want to expand this so changes to a/ and subdirectories are stored too. Is there any way to do this simply?

+1  A: 

Move b to somewhere new, make a new directory in it called b and git mv the contents into it. Now cp the stuff from a (excluding the original b of course) into here and git add them.

thenduks
That works, though sadly I can't use it in my actual repository - it's actually a git repository set up inside another proprietary repository and they don't play nicely at the best of times, let alone doing something a "bit different" like this. Thanks for the answer though :)
Ben Hymers
+1  A: 

Try this, starting from to dir of the git repository:

$ mkdir b
$ git mv * b/
$ git commit  # describe that contents have moved
$ cd ..
$ mv b/* .
$ rmdir b
Jakub Narębski