Contributor(s): Andres Montano, Jed Verity
Already configured in dev.thlib.org (in master branch): Dictionaries, KMaps, MMS, Places. Already configured in staging.thlib.org (in staging branch): Dictionary, KMaps, MMS, Places. Already configured in thlib.org (in stable branch): Dictionary, KMaps, MMS, Places
Note: It may make the most sense NOT to check out these plugins from these repositories to work on them, but to check them out as submodules of the individual apps (kmaps, mms, or places) instead. See the instructions for "Working with an Existing Repository" below.
1. Getting a local repository. Make sure to use the private URL (git@github.com…) for your development machine to allow you to push your changes back to the GitHub repository. If cloning doesn't work, contact Andres to be added as a collaborator to the repository.
git clone git@github.com:thl/mms.git mms cd mms git submodule init git submodule update
2. Staging and committing changes to the local repository on your development machine. If you are working with plugin (aka submodule) code, see the special "Modifying Plugins" instructions below.
git add . git commit
3. Pushing changes to remote repository (GitHub):
git push
4. Getting changes from remote repository (GitHub):
git pull origin master
git submodule update
It might make the most sense NOT to check out plugins from their individual repositories, but to work with them as submodules of the individual apps (kmaps, mms, or places) instead. If you have cloned any of these apps, you automatically pulled down the plugin code when you did "git submodule update." Just be sure to follow these steps before making any changes.
1. Go into the plugin folder, for example:
cd vendor/plugins/mms_engine
2. Check the remote repository URL:
git remote -v
3. If origin is pointing to a read-only URL (i.e. does not start with git@), change it to private URL. If its already pointing to private URL, you should skip this step. Doing this won't change the submodule URL; it will still point to the public URL, but now it will allow you to commit changes directly from your clone repository.
git remote rm origin git remote add origin git@github.com:thl/mms_engine.git
4. Confirm what branch you are in.
git branch
5. If you are not in master, but in "(no branch)", then you should check out master. If you are in master, you should skip this step. This has to be done before you make your changes or you'll lose them.
git checkout master
1. Push plugin code back to the remote repository. While in the plugin directory (e.g. vendor/plugins/mms_engine), do the following:
git add . git commit git push
2. Push the plugin changes for the whole app project itself:
cd ../../.. git add . git commit git push
3. Update the app project with all the latest code:
git pull git submodule update
1. Check out the project and go to the plugin folder. For example:
cd vendor/plugins/mms_engine
2. Confirm what branch you are in:
git branch
3. If you are not in master, but in (no branch), then you should check out master. If you are in master, you should skip this step. This has to be done before you make your changes or you'll lose them.
git checkout master
4. Pull changes:
git pull origin master
If that doesn't work, try merging the changes:
git merge origin/master
5. Push the reference to the latest release for that plugin/submodule:
cd ../../.. git add . git commit git push
6. Update all changes:
git pull git submodule update
git branch stable
git push origin stable
git checkout --track origin/stable
git remote show origin
git fetch
git pull
git checkout stable
git merge master
git checkout master
git push
In order to delete new files that you don't want in the repository run:
git clean -f -d
Check if your in master:
git branch
If you are in no branch run:
git checkout -f master
else you can simply run:
git checkout -f
.gitmodules .git/config
git rm --cached path/to/submodule
Note: Do not put a trailing slash at the end of path. If you put a trailing slash at the end of the command, it will fail.