Developing With Git  page     

Thank you so much for developing with git. You're making the world better for yourself and others. With GIT we can see any change you make to JavaScriptMVC and share them with other people.

Before we get started, we're assuming you:

  • know git
  • have a github account setup
  • have a project that is already using git

If you don't, you might find the following resources helpful:

Git-ing JavaScriptMVC

JavaScriptMVC is comprised of five sub projects:

We're going to fork each of these projects and add them as submodules to your master git project.

Forking

Assuming you have a github account set up, and are signed in, click each of the github links and click the fork button (in the upper right of the page).

PRO TIP: If you're working for a company, you should create company forks and give employees access to the company forks. This will keep everyone using the same version.

Installing with a script

To make the next several steps easier, we've made scripts for Mac and Windows users that automate adding your repos and setting them up.

Use this script to install JMVC from github or your own fork. If its already installed, it will get latest for all the submodules.
Assumes your project uses git.

Options:
  • -u username (default is jupiterjs)
  • -b branch (default is master)
  • -s source url (default is https://github.com)
  • -p install path (default is current directory)
Usage

Windows users can ignore the ./ in the path:

Default usage. This will install from https://jupiterjs@github.com/jupiterjs/steal.git

./getjmvc

Use your own forked submodule repositories. This will install from https://github.com/mycompany/steal.git

./getjmvc -u mycompany

Install to your own path. You can specify the path where the submodules are installed, like to public/

./getjmvc -p public/

Install a different branch (used to install the 2.0 branches for steal, jquerymx, and funcunit).

./getjmvc -b 2.0

Install from a different repository (not github) or from ssh instead of http (if you have write access).

./getjmvc -s git@github.com
./getjmvc -s http://mygitrepo.com

Update code. If you installed somewhere besides the current directory, specify a -p. This will update code in each submodule.

./getjmvc
./getjmvc -p public/

Note: This script installs steal, documentjs, jquerymx, and funcunit, and it downloads syn from whatever is in funcunit/.gitmodules.
If you wish to fork your own syn and use that fork, you have to change your funcunit/.gitmodules to point to the right location manually.
Check it in and future installs will work fine.

If you just want a certain repo, or you like doing things the hard way, here's how to get each project yourself:

Adding a submodule

Now add the first four forked repositories as submodules to your project like:

git submodule add git@github.com:_YOU_/steal.git public/steal
git submodule add git@github.com:_YOU_/jquerymx.git public/jquery
git submodule add git@github.com:_YOU_/documentjs.git public/documentjs
git submodule add git@github.com:_YOU_/funcunit.git public/funcunit

Note: Learn a little more about submodules here.

There are 3 important things to notice:

  1. Change YOU with your github username.

  2. Add the submodules in a public folder, where the server hosts static content.

  3. Copy the javascriptmvc repository into a jquery folder.

Next, you have to install and update the submodules. Run:

git submodule init
git submodule update

You may also have to change to each directory and checkout the master branch:

cd steal
git checkout master

Installing Syn

Syn is a submodule of the funcunit project. To add your fork to funcunit, first you have to change the submodule to point to your fork (because it points to the jupiterjs fork). To do this, open funcunit/.gitmodules. You'll see:

[submodule "syn"]
    path = syn
    url = git@github.com:jupiterjs/syn.git
    update = merge

Change the URL to your own fork, like:

url = git@github.com:_YOU_/syn.git

Now install syn, like the other submodules:

cd funcunit
git submodule init
git submodule update
cd syn
git checkout master

Finally, you just have to move the 'js' commands out of steal for convienence:

[WINDOWS] > steal\js steal\make.js

[Lin/Mac] > ./steal/js steal/make.js

Yes, that was more annoying then just downloading it, but you're making the world a better place for yourself and for others.

© Jupiter IT - JavaScriptMVC Training and Support