The short version (off the top of my head):
- Create your own github account
- Create a fork of MODX by clicking on the fork button at the MODx repo
- If on Windows, do this so your line endings won't cause trouble: git config --global core.autocrlf true
[li]Clone your fork with git clone -- you'll be on your master branch: git clone [email protected]:yourGitUsernameHere/revolution.git modx
- You need two remotes, origin (your fork) should already exist. Create a second called upstream pointing to the MODX repo:
- git remote add upstream http://github.com/modxcms/revolution.git
- Create a tracking branch that tracks the MODx repo:
[li] git fetch upstream
- git checkout -b develop upstream/develop
- Just before making any changes, update your local develop branch (be sure you're on that branch):
- git fetch upstream develop
- git merge --ff-only upstream/develop
- Create a branch to work on your contribution (e.g., git checkout -b mycode)
- Make your changes.
- Make sure your changes are staged (git add . ) -- note the dot
- Commit your changes with a comment (e.g., git commit -a -m "Here's what I did")
- Type git status to make sure everything got committed
- Just before issuing your pull request, update again, but like this:
- git fetch upstream develop
- git rebase upstream/develop (rebase will tack your changes on to the end of any MODX changes)
- Push your new branch to your fork (git push origin mycode)
- Go to the modx repo at GitHub and make a pull request to pull your mycode branch into the MODx dev branch
- Have a beer
Never merge your own changes into the develop branch and never make changes in that branch yourself. If you do, and MODX uses your pull request, your changes will be in there twice when you update develop and future pull requests from you will be very difficult to use.
For future pull requests, switch to your develop branch (git checkout develop), update it with fetch/merge and create a *new* branch to work following the steps above from that point on.
Optional: You can remove the unnecessary local branches and unnecessary branches at your fork (e.g., master, release 1.1, etc. This will free up disk space and cut down on the clutter. Be sure not to delete the develop branch.
This will show you all the local branches: git remote
This will show you the remote branches: git remote -r
remove local branches with: git branch -D branchname
remove remote branches at your fork with: git push origin :branchname
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html