Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] git and sub-directories
- Date: Sun, 13 Mar 2011 21:36:08 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] git and sub-directories
- References: <4D7CAC72.2020902@example.com>
On Sun, Mar 13, 2011 at 8:37 PM, Darren Cook <darren@example.com> wrote: > I notice I have a .git subdirectory in both the top directory and the > settings subdirectory. I guess I did "git init" in the settings > directory first, then added the parent directory later. > > So how do I (a git beginner) fix this mess? Just deleting settings/.git/ > is bad as then I'd lose some commit history? It depends on what you want to do with your history, and how bad you want to keep it. I assume you only have one branch in settings. If you have more than one you want to save, you'll need to specify each branch to fetch command separately. First :-) rsync -a top /tmp/saved.top Then you could try (in top) git fetch settings git rebase --root --onto master FETCH_HEAD This will probably put all files in top/settings in top. Then rm -rf settings, mkdir settings, and git mv all those files back into settings. You could probably do some magic with filter-branch to avoid the ugliness of the git mv step, but I don't have time for that right now. The idea is to use --tree-filter to mv the files, but that will require some non-trivial scripting to identify the right ones.
- References:
- [tlug] git and sub-directories
- From: Darren Cook
Home | Main Index | Thread Index
- Prev by Date: [tlug] git and sub-directories
- Next by Date: Re: [tlug] Thoughts and prayers from America
- Previous by thread: [tlug] git and sub-directories
- Next by thread: [tlug] Power outages
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links