Home > Mobile >  How can I change the name of a folder on a new branch and merge to master branch without replacing t
How can I change the name of a folder on a new branch and merge to master branch without replacing t

Time:11-03

I have created a new branch and made changes to folder X. At some point we realized that we need to keep the old methodology for several purposes. Now I would like to enter the altered folder under a new name (let's call it X_Y) to the master folder, so that master will have both X and X_Y.

I'm new to git and mainly doing data related things locally normally, so my first attempt didn't take into account git info - I copy pasted the folder from the new branch to a different local folder, then I renamed it to X_Y, and pasted X_Y folder to the master with the new name. However now it doesn't work from master branch - one error example: TypeError: expected str, bytes or os.PathLike object, not NoneType - it has no such issues in the new branch with the old name. I understood that it is expected not to work as it is wrong to do it this way. How would I go about doing that simply and quickly?

CodePudding user response:

Seems that the described process is valid in theory, although in practice some of the files weren't copied in the process, specifically the __init__.py files in the subdirectories. After I added those manually, everything worked.

  •  Tags:  
  • git
  • Related