I solved the original issue by deleting my fork and my MODx directory and starting over.
In the process, I think I may have found a workflow that makes sense with Git.
I created my own fork of MODx and cloned it locally:
So I have a master branch based on my fork (referred to as Origin).
I configured a new remote called "modx" that points to the MODx repository:
git remote add modx http://github.com/modxcms/revolution.git
updates my master to match the current state of the MODx 2.0 branch. I have to make sure that "git status" shows everything is clean before doing the pull.
If I had local changes to master that I wanted to keep, I’d use this instead:
but I don’t think I ever will because I’ll only work on branches I create.
To contribute, I create a branch and switch to it:
git branch bugfix
git checkout bugfix
On that branch, I edit files and do
Now I push the branch with the changes to my fork:
And issue a pull request for that branch, then do
Each change I make is on a separate new branch with a new name.
Since I never modify my master branch, and always pull or rebase from the MODx repo, it’s always up to date.
The changes I make in the local branches are never merged into my master branch, but I get them there when I pull or rebase from the MODx repo if the pull request is honored and, if not, I don’t want them.
Once the changes are accepted or rejected, I can delete those local branches with:
And then delete the remote branches with:
It sounds like you have changes you want to keep, so I think you could merge them into your master branch and always use:
I don’t know if this all works, but it’s the only thing I could think of that makes sense and, so far, it seems to be working.
My only question is whether deleting the remote branches after the pull request has been honored could affect the MODx repo -- causing the loss of the changes, but it doesn’t seem like it should.
Hopefully, we’ll get some feedback soon from the git gurus so we know how to work.