mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-09-01 00:00:06 +02:00
Python wants filenames with underscores instead of hyphens and with a .py extension. We really want the main file named git-filter-repo, but we can add a git_filter_repo.py symlink. Doing so dramatically simplifies the steps needed to import it as a library in external python scripts. Signed-off-by: Elijah Newren <newren@gmail.com>
13 lines
313 B
Python
Executable File
13 lines
313 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import git_filter_repo as fr
|
|
|
|
def my_commit_callback(commit):
|
|
if commit.branch == "refs/heads/master":
|
|
commit.branch = "refs/heads/develop"
|
|
|
|
args = fr.FilteringOptions.default_options()
|
|
args.force = True
|
|
filter = fr.RepoFilter(args, commit_callback = my_commit_callback)
|
|
filter.run()
|