On Mon, 21 Jul 2008 20:39:45 +0200 Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote: > However, I think that the OP was talking about something completely > different: extracting the history of a single file as a new branch. Exactly, but rather than a new branch I'd like to start a new project. I've just realized the original subject name could have been a bit misleading; I took it from the description a guy on #git@freenode has given of what he thought I wanted to do, but probably I didn't explain myself properly at that time. > This will not start a new branch, which is what I presume you want to > do. The "correct" (as in: probably the best) way to do it is to make a > new directory, initialize a new git repository in it, and when you > have something, push that branch into the other repository. As far as I could understand, that screencast demonstrates how to create empty branches in Git; in other words branches that are not derivatives of your main branches, but entirely new projects. In my case I don't want to start an entirely new project, but rather start a new project from a file of an existing project and keeping his history. In the screencast, the author creates an empty branch to store the website code in for my project, so he doesn't have to store it as a subdirectory of his main project. What I want to do, I think, is kinda different. Let's say we are at commit #3000, I have this content I want to start a new project from, which has been put in three different files: path1/filename1 from commit 1 to commit 1000 path2/filename1 from commit 1001 to commit 2000 path2/filename2 from commit 2001 to commit 3000 In the meanwhile path1/filename1 has been created on commit 2500 with path1/filename1 having nothing to do with the new project I'd like to start. My first idea to accomplish what I'd like to do, was to use the ouput of `git-log -p --follow path2/filename2` with another git command; on #git@freenode I've been suggested to use git-clone and git-filter-branch. Both from search results on the web and from the man pages, I've found examples of git-filter-branch usage which aim to delete just one file (or a small group of files) from the existing project's history. What I'd like to do instead is to keep just one file which has been renamed a couple of time. On #git I've been also told to use also another combination of commands which included git-commit-tree but I haven't managed to understand what they meant. Another combination of commands included git-am instead. Any suggestion is welcome. :)
Attachment:
signature.asc
Description: PGP signature