0

I am working on a Python project with git that was recently restructured to be distributed as a Python package using setuptools. Unfortunately, not all branches were restructured, and I need to rebase some commits from an unmodified branch to the one with the correct structure. Git won't do this automatically, so how do I do this properly?

For example:

The old setup was:

A/
B/
C/
D/

The new setup is:

A/
E/
|--__init__.py
|--B/
|--C/
|--D/
F/
setup.py

Where B, C, and D all contain Python files to be included in the package.

Thank you!

2
  • Possible duplicate of Git rebase with renamed files Aug 6, 2019 at 19:19
  • See stackoverflow.com/q/42568138/1256452 (as in Greg Burghardt's comment). Remember that rebase is (in effect) repeated cherry-pick, and each cherry-pick is (in effect) a merge. So for each commit that you're going to merge/pick you must enable rename-finding at a level at which it finds the appropriate renames.
    – torek
    Aug 6, 2019 at 20:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.