git-filter-branch

Detach subdirectory into separate Git repository

I have a Git repository which contains a number of subdirectories. Now I have found that one of the subdirectories is unrelated to the other and should be detached to a separate repository. How can I do this while keeping the history of the files within the subdirectory? I guess I could make a clone and remove the unwanted parts of eac...

Change first commit of project with git?

I want to change something in the first commit of my project with out losing all subsequent commits. Is there any way to do this? (I accidentally listed my raw email, and I'd like to change it as I'm getting spammed from bots indexing github.) Edit/Addendum (whereby "listed my raw email" I mean listed my raw email in a comment in the ...

Repeatedly using git-filter-branch to rewrite new commits

I would like to split out modules distributed with a bigger application into separate submodules and keep the ability to pull from upstream. So this is more complex than Detach subdirectory into separate Git repository. I do not only have do use git-filter-branch once but want to keep the ability to pull upstream changes after I have do...

How to split a git repository while preserving subdirectories?

What I want is similar to this question. However, I want the directory that is split into a separate repo to remain a subdirectory in that repo: I have this: foo/ .git/ bar/ baz/ qux/ And I want to split it into two completely independent repositories: foo/ .git/ bar/ baz/ quux/ .git/ qux/ # Note: still a subdire...

Detach many subdirectories into a new, separate Git repository

This question is based on http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository Instead of detaching a single subdirectory, I want to detach a couple. For example, my current directory tree looks like this: /apps /AAA /BBB /CCC /libs /XXX /YYY /ZZZ And I would like this instead: /apps...

How can I move a directory in a Git repo for all commits?

Let's say I have a repo that includes this directory structure: repo/ blog/ _posts/ some-post.html another-file.txt I want to move _posts to the top level of the repo, so the structure will look like this: repo/ _posts/ some-post.html another-file.txt This is simple enough with git mv, but I want to make the h...

Can tags be automatically moved after a git filter-branch and rebase?

edit The question boils down to "Can git rebase be instructed to rebase tags, too?" But an answer to the original question would also help. Asking How to prepend the past to a git repository? I followed these instructions. <edit>Then I rebased to include a file that was only in the snapshots, see here.</edit> Since history was rewritt...

How to modify git repository to add submodules in ALL the past revisions?

I migrated my SVN repository successfully with Tags into Git using git svn-clone. However, git svn-clone does not migrate svn:externals. Hence, I decided to modify branch tree using git filter-branch. For svn:externals, first I created a separate Git repository for each svn:externals and then I tried using the following, but it didn't w...

Using git filter-branch to rewrite authors/committers and commit messages simultaneously

I have a Git repository originally imported from Subversion. Parts of the author/committer information are wrong, which is not Git's fault but mostly due to sloppy committing with Subversion. I would like to use git filter-branch to rewrite the history of the repository, fixing the committer and author information. The trouble is... I...

Splitting a subdirectory with submodules into a separate git repository

As a subset of the question detach-subdirectory already made before and considering the fact that even though a lot of questions were made about the process of splitting and merging git repositories, I couldn't find one that touches the subject of splitting when submodules are present. So in the following scenario: .git/ .gitmodules fo...

How do I split a Git repository cleanly?

This question took me part of the way, but I'm still missing something. I have a single-user repository (so no problems with rewriting history vs push/pull) where I have developed product code and support code and documents together. After a year-or-so's work, I have finally seen the light, and want to split my repo in two. This is wha...

filtering out other files, respecting renames

I've got a repository that effectively contains a bunch of different modules. I'd like to split it out into separate repositories, keeping the version history of the files in those repositories. A simple approach to this problem would just involve cloning the repo and then doing something like git filter-branch \ --tree-filter $'f...

Filter Out Branch in Git when Cloning

I have a large repository that I am trying to clone, but there seems to be a few PSD files that have been added that I can't avoid at the current moment. I have a specific path on the repository that I want to checkout but I'm having trouble figuring out what specific command I need to follow. I was told filter-branch is what I need to ...

Importing a Subversion repository with a non-standard layout into Git

I'm trying to (permanently) migrate my group's Subversion repository to Git, but I'm running onto problems trying to clean up its non-standard directory structure. Some of the project's content is contained in trunk and branches folders, but not all of it. The project on Subversion is laid out like this: project/trunk/ project/branches...

Split large Git repository into many smaller ones

After successfully converting an SVN repository to Git, I now have a very large Git repository that I want to break down into multiple smaller repositories and maintain history. So, can someone help with breaking up a repo that might look like this: MyHugeRepo/ .git/ DIR_A/ DIR_B/ DIR_1/ DIR_2/ Into two repositories th...

How can I rewrite history so that all files are in a subdirectory?

I have a project under git. One day I moved all project files from current directory to foo/bar/ under the project. I did it using git mv. Then I added some more files and did some changes to already existing files. As a result, now when I look at the history of foo/bar/file.c, I can only see changes that I did after I moved the file. ...