I apologize in advance. I am very new to git and I just took over a project that is stored in git.
Here is my situation - The project I took over has a directory structure that isn't standard in my organization.
I created new branches with the new dir structure, I used git mv. I need to make the branch names standard. There is already a branch with a standard name but with the wrong dir structure.
I am working on a branch named "develop", it has the dir structure we want. I mostly understand merge, but I don't quite understand rebase yet. Essentially I need to make the other non standard branches be exactly like the "develop" branch.
Merge won't work because of the dir structure changes, I have already tried.
How do I simply make the other branches exactly like "develop"?
UPDATE:
I realized I could practice as long as I didn't push to remote.
Previously, I picked one of the branches to change the dir structure ("test" branch):
cd into the dir that you want to move files into
Type this command (this represents the current dir structure that you want to change)
git mv OldDir1/OldDir2/* .
Notice the period at the end, following the space after OldDir2/*
Commit and push. Note: this will delete the history of each file.
I also did this to the "develop" branch earlier.
Now, both branches (develop, test) have the new dir structure.
Then:
git checkout develop git checkout test git rebase develop
At this point, it couldn't resolve the podfile and podfile.lock files.
Sourcetree showed pull (2) and push (number of commits ahead).
I tried several things and couldn't get sourcetree to take the podfile from develop, it kept wanting to take the podfile from the test branch.
It wouldn't push until I resolved the pull (2), which was the two podfiles mentioned.
I finally just pulled the two podfiles and commited/pushed even though they were out of date.
I will change them and push.
This accomplished what I wanted, and I have check several files for recent changes to make sure "test" is current with "develop".