PHP Web Server
Some common ones:
- Mac - MAMPP
- Mac, Windows - XAMPP
- Linux - Apache
sudo apt-get install apache2 libapache2-mod-php5 php5 php5-common
Git
If you do not have git installed, check these out:
-
Open a terminal (command prompt)
-
Change directory (cd) to your web root directory, whatever that might be:
cd /path/to/your/www/root/
-
Clone your jQuery Mobile fork to work locally
git clone [email protected]:username/jquery-mobile.git
-
Change directory to the newly created dir: jquery-mobile/
cd jquery-mobile
-
Add the jQuery Mobile master repo as a remote. "upstream" is a good name for it
git remote add upstream git://github.com/jquery/jquery-mobile.git
-
Get in the habit of pulling in the "upstream" master to stay up to date as jQuery Mobile receives new commits
git pull upstream master
-
(Mac/*Nix) Build the jQuery Mobile source
make
(Windows) You will need someway to build makefiles
Open the jQuery Mobile test suite in the browser of your choice.
Navigate to http://localhost/jquery-mobile/
or whatever your jQuery Mobile
folder is called.
If you see the jQuery Mobile Docs page, then this was a success! You just cloned and built jQuery Mobile!
-
Find a bug you think you can fix from the list at jQuery Mobile Issues
-
Follow the directions above to checkout a clone of the repository or navigate to your existing checkout
-
Create a new branch to work in:
- Always use a branch to work in as working in master will get messy
- Find the issue number in Github for the bug you want to fix. It will be 4 numbers long.
- Make sure you start with your up-to-date master
git checkout master; git pull upstream master
- Create and checkout a new branch that includes the ticket (issue_####
where #### is the 4 digit issue number )
git checkout -b issue_####
- This will create a new branch (-b), if it does not exist yet, named issue_#### and then switches you into that branch (checkout)
-
Open up your favorite text editor and make the changes you want that will fix the issue referenced.
-
Run the unit tests to confirm that you have not broken anything.
- Navigate to the
http://localhost/jquery-mobile/tests/unit
(or whatever your local checkout directory is called. - Ensure all tests still pass
- Edit your code if it causes a test to fail
- Navigate to the
-
Commit your changes once you are done editing the files and the tests pass:
- Stage the files to be tracked:
git add filename(s)
You can use "git status" to list the files you have changed. I recommend NEVER, EVER using "git add . "
- Once you have staged all of your changed files, go ahead and commit them:
git commit -m "Issue #####: Brief description of fix"
- Then, push your branch with the bug fix commits to your github fork
git push origin -u issue_####
- Stage the files to be tracked:
-
Before you tackle your next bug patch, return to the master:
git checkout master
-
Submit a Pull Request to actually submit your patch:
- Go to http://github.com/your-username/jquery-mobile
- Click the branch switcher on the right and choose the branch that has your patch.
- Once the branch is loaded, click on "Pull Request". Be sure to include the ticket #### in the subject, along with a brief description.
- Submit the Pull Request
-
Congratulations, you just submitted your Patch! Thanks for your help.
Thanks to Rick Waldron for the original gist: http://docs.jquery.com/Tips_for_jQuery_Bug_Patching
Feel free to add YOUR tips in the comment section below!
Hi @eddiemonge!
Thanks for the notes! It helps a lot!
I'm on the way to clone my github repo to local (btw as you said, 102.40 MiB are a bit surprising)
After my first try to clone and open the docs and demos, some scripts and css-files could not be loaded,
because the index.html assumes that .php is the default suffix on my webserver. But it is not and I've added index.php to them.
Wouldn't it be better that this is the default?