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

I’ve written a script that does this. $ git-rebase-tags master Rebasing 107 tags onto ‘master’ Can’t rebase tag ‘staging-deploy-01’ because there are no identical commits on ‘master’ Pointed tag ‘v0.0.11’ at commit 81e16f2ca1bc7802547bf19c1dba1a68212eafff Pointed tag ‘v0.0.12’ at commit 17051cc28084dd56ae56e96767bceee46217c02d Pointed tag ‘v0.0.13’ at commit 5d795076ba4b33f81d327dcf9bff727cef7771a2 […] See gist.github.com/908381. But even better, use the –tag-name-filter option … Read more

Rewrite history git filter-branch create / split into submodules / subprojects

I resolved my own question, here is the solution: git-submodule-split library another_library Script git-submodule-split: #!/bin/bash set -eu if [ $# -eq 0 ] then echo “Usage: $0 submodules-to-split” fi export _tmp=$(mktemp -d) export _libs=”$@” for i in $_libs do mkdir -p $_tmp/$i done git filter-branch –commit-filter ‘ function gitCommit() { git add -A if [ … Read more

How can I rewrite history so that all files, except the ones I already moved, are in a subdirectory?

To rewrite the history with the files moved: If you want the project’s history to look as though all files have always been in the directory foo/bar, then you need to do a little surgery. Use git filter-branch with the “tree filter” to rewrite the commits so that anywhere foo/bar doesn’t exist, it is created … Read more

Could I change my name and surname in all previous commits?

Use git-filter-branch. git filter-branch –commit-filter ‘if [ “$GIT_AUTHOR_NAME” = “Josh Lee” ]; then export GIT_AUTHOR_NAME=”Hobo Bob”; export [email protected]; fi; git commit-tree “$@”‘ This only affects the author, not the committer (which for most commits will be the same as the author). If you want to rewrite those as well, set the GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL variables. … Read more