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: Mon, 04 Apr 2011 18:39:09 +0900
- From: Darren Cook <darren@example.com>
- Subject: Re: [tlug] git and sub-directories
- References: <4D7CAC72.2020902@example.com> <AANLkTinPX9PPGf6ZUsaVtHUAapdw0bW6x09c2t0S9xsR@example.com>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
>> 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? Thanks for the reply Stephen. Delay in replying is as I wanted to study a bit more git in the hope of understanding your reply. I think I've just about got it, but in the end I used git log in each directory and decided to just recommit the most recent file from the top directory, then: rm -rf settings/.git I only lost three commit comments and I decided I could live without them. BTW, how do I post a bug report for git? After 10 minutes of googling the closet I've got is posts by two other people complaining they cannot find out how either. Darren > > 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. > -- Darren Cook, Software Researcher/Developer http://dcook.org/work/ (About me and my work) http://dcook.org/blogs.html (My blogs and articles)
- Follow-Ups:
- Re: [tlug] git and sub-directories
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] UPS batteries
- Next by Date: Re: [tlug] git and sub-directories
- Previous by thread: Re: [tlug] Command to find directories containing a particular size of data
- Next by thread: Re: [tlug] git and sub-directories
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links