* [[TheMagPiPdf|PDF creation]] - instructions for the generation of PDF for electronic and paper publication.

== Setting up access ==

== Setting up access ==

Line 16:

Line 14:

Several people would rather not read the [http://git-scm.com/book/en/ git book]. Therefore, some scripts were written to simplify the usage slightly. Git is not a replacement for good communication. Remember to update the local git repository before starting work on something and commit changes back to the repository frequently.

Several people would rather not read the [http://git-scm.com/book/en/ git book]. Therefore, some scripts were written to simplify the usage slightly. Git is not a replacement for good communication. Remember to update the local git repository before starting work on something and commit changes back to the repository frequently.

to check out the issue 11 repository. The script will not check out the repository again if a local copy already exists in the present working directory. One than one repository can be requested at once. For example,

+

to clone the issue 11 repository. The script will not clone the repository again if a local copy already exists in the present working directory. More than one repository can be requested at once. For example,

<pre>

<pre>

mp-git-clone.sh 11 12 13 templates

mp-git-clone.sh 11 12 13 templates

</pre>

</pre>

−

will check out the issue 11, 12 and 13 repositories as well as the templates repository.

+

will check out the issue 11, 12 and 13 repositories, as well as the templates repository.

==== mp-git-commit.sh ====

==== mp-git-commit.sh ====

Line 68:

Line 66:

</pre>

</pre>

to update the local copy with any changes from the github repository, where 'all' is optional. If all is used, all repositories within the mp-git/ parent directory are checked.

to update the local copy with any changes from the github repository, where 'all' is optional. If all is used, all repositories within the mp-git/ parent directory are checked.

+

+

==== Using Proxy ====

+

If you need to use a proxy:

+

HTTP_PROXY="http://username:pwd@theproxyserver.com:port/"

+

git config --global http.proxy $HTTP_PROXY

+

+

== Tagging ==

+

+

While git tagging is not currently scripted, the git commands can be used to tag and push the tag back to the repository. There purpose of tagging is to keep track of a version of many files at one point in time. A good application would be to tag the repository once at the time of electronic publication and then once when printing. Then one could refer to the printed version just by a tag, rather than risk some additional changes to the repository being included.

Contents

Setting up access

The first step is to create a github account. Then for those on the MagPi layout team, email the editor for permission to join the github organisation.

Since the Raspberry Pi does not have a great deal of processor power, it is better to use the command line tools to access github. For OSX and Windows there are GUI tools available for download on the github site.

Tools for LINUX or OSX

Several people would rather not read the git book. Therefore, some scripts were written to simplify the usage slightly. Git is not a replacement for good communication. Remember to update the local git repository before starting work on something and commit changes back to the repository frequently.

mp-git-setup.sh

Type

mp-git-setup.sh

to install and configure git. The script has no action if the installation and configuration is already okay.

mp-git-clone.sh

The script expects that the repositories will be in a parent directory called magpi-git. (This can be overridden by setting the environmental variable MP_GIT_DIR to the full path of the parent directory.) If the magpi-git directory does not already exist,

mkdir magpi-git; cd magpi-git

Then type

mp-git-clone.sh 11

to clone the issue 11 repository. The script will not clone the repository again if a local copy already exists in the present working directory. More than one repository can be requested at once. For example,

mp-git-clone.sh 11 12 13 templates

will check out the issue 11, 12 and 13 repositories, as well as the templates repository.

mp-git-commit.sh

Type

mp-git-commit.sh 'A message goes here' [all]

where the string 'A message goes here' should be replaced with a sensible and informative message and the text 'all' is optional. If all is used, all repositories within the mp-git/ parent directory are checked.
The script adds any new few files, commits to the local repository, fetches and remote changes and then merges the local changes into the remote repository. (Git does not allow empty directories to be added)

mp-git-update.sh

Type

mp-git-update.sh [all]

to update the local copy with any changes from the github repository, where 'all' is optional. If all is used, all repositories within the mp-git/ parent directory are checked.

Using Proxy

Tagging

While git tagging is not currently scripted, the git commands can be used to tag and push the tag back to the repository. There purpose of tagging is to keep track of a version of many files at one point in time. A good application would be to tag the repository once at the time of electronic publication and then once when printing. Then one could refer to the printed version just by a tag, rather than risk some additional changes to the repository being included.