Difference between revisions of "HOW-TO check out PKP applications from git"

From PKP Wiki
Jump to: navigation, search
m (Protected "HOW-TO check out PKP applications from git" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
(Check out the application(s) on your local machine)
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
= Intro =
 
 
This is the official process to check out OMP with the PKP library as a sub-module. The same process applies to all other PKP projects. Just exchange omp for ojs, ocs or harvester.
 
 
 
= Create github.com user =
 
= Create github.com user =
  
This tutorial assumes that you'll work with forked copies of our software on github and that you intend to publish your changes back. You can do without forks, especially if you want to have only read access. You'll have to adapt this process a bit then (e.g. exchange the read/write URLs to forks with read-only URLs to the master repository). Please refer to the git documentation for this.
+
This tutorial assumes that you'll work with forked copies of our software on github and that you intend to publish your changes back. You can do without forks, especially if you want to have only read access; in that case you may have to adapt the process slightly. Please refer to the git documentation for this.
  
 
If you want write access to the repository then go to github.com and create your own user account there and log into it. See the [http://help.github.com/key-setup-redirect/ github documentation] to generate/add your RSA key to your github account.
 
If you want write access to the repository then go to github.com and create your own user account there and log into it. See the [http://help.github.com/key-setup-redirect/ github documentation] to generate/add your RSA key to your github account.
  
If you want to write back to the official PKP git repositories then you'll need write access there. Please ask Juan or Florian to grant you access.
+
If you want to write back to the official PKP git repositories then you'll need write access there. Please contact the team if you wish to request commit access to the official PKP repositories. Generally we accept contributions using github.com pull requests from your own fork, rather than granting official commit access.
  
 
= Delete existing personal forks =
 
= Delete existing personal forks =
Line 21: Line 17:
 
* Go to Admin tab.
 
* Go to Admin tab.
 
* Down on the page click on "Delete This Repository".
 
* Down on the page click on "Delete This Repository".
* Repeat these steps for both omp and pkp-lib
+
* Repeat these steps for all forks of PKP repositories
  
 
= Fork the official application repositories =
 
= Fork the official application repositories =
  
* Go to http://github.com/pkp/omp and fork it.
 
 
* Go to http://github.com/pkp/pkp-lib and fork it.
 
* Go to http://github.com/pkp/pkp-lib and fork it.
 +
* Go to http://github.com/pkp/omp and fork it.
 
* Go to http://github.com/pkp/ojs and fork it.
 
* Go to http://github.com/pkp/ojs and fork it.
 
* Go to http://github.com/pkp/ocs and fork it.
 
* Go to http://github.com/pkp/ocs and fork it.
Line 35: Line 31:
 
= Check out the application(s) on your local machine =
 
= Check out the application(s) on your local machine =
  
Use the shell script [[Media:Checkout.sh.txt|checkout.sh]] to check out each application that you wish to work on:
+
Use the following commands to check out an application on your local system:
 
<pre>
 
<pre>
sh checkout.sh.txt your-user ojs ojs-checkout
+
git clone git://github.com/your-user/ojs ojs-checkout
 +
cd ojs-checkout
 +
git submodule update --init --recursive
 
</pre>
 
</pre>
In the above example, "your-user" is your github.com username. It will check the "ojs" application out into a directory called "ojs-checkout".
+
In the above example, "your-user" is your github.com username. It will check the "ojs" application out into a directory called "ojs-checkout". The "git submodule" command will take care of setting up the relevant submodules; you may need to add your own remote fork of the pkp-lib submodule in order to make changes within the lib/pkp directory.
  
 
= Where to go from here? =
 
= Where to go from here? =

Latest revision as of 14:54, 27 March 2014

Create github.com user

This tutorial assumes that you'll work with forked copies of our software on github and that you intend to publish your changes back. You can do without forks, especially if you want to have only read access; in that case you may have to adapt the process slightly. Please refer to the git documentation for this.

If you want write access to the repository then go to github.com and create your own user account there and log into it. See the github documentation to generate/add your RSA key to your github account.

If you want to write back to the official PKP git repositories then you'll need write access there. Please contact the team if you wish to request commit access to the official PKP repositories. Generally we accept contributions using github.com pull requests from your own fork, rather than granting official commit access.

Delete existing personal forks

First you have to delete existing personal forks of omp/pkp-lib if you have cloned these repositories before. You obviously shouldn't do this when there are still changes in there you don't have in other locations! If you don't have existing forks then you can jump to the next step.

Otherwise do the following:

  • Go to your personal github dashboard.
  • In "Your Repositories" select the forks you want to delete.
  • Go to Admin tab.
  • Down on the page click on "Delete This Repository".
  • Repeat these steps for all forks of PKP repositories

Fork the official application repositories

You can fork a subset of these projects if you do not intend to work on all of them. You'll always need the pkp-lib repository together with any of the application-specific repositories.

Check out the application(s) on your local machine

Use the following commands to check out an application on your local system:

git clone git://github.com/your-user/ojs ojs-checkout
cd ojs-checkout
git submodule update --init --recursive

In the above example, "your-user" is your github.com username. It will check the "ojs" application out into a directory called "ojs-checkout". The "git submodule" command will take care of setting up the relevant submodules; you may need to add your own remote fork of the pkp-lib submodule in order to make changes within the lib/pkp directory.

Where to go from here?

Have a look at frequent git use cases for typical git use cases you'll encounter in your day to day work with git.

Resources

"Git cheat sheet"