Difference between revisions of "TheMagPiGit"

From eLinux.org
Jump to: navigation, search
(Setting up access)
(Using github)
Line 31: Line 31:
 
=== Using github ===
 
=== Using github ===
  
  * At the start of an editing session (when you log into the Raspberry Pi), type:
+
* At the start of an editing session (when you log into the Raspberry Pi), type:
 
<pre>
 
<pre>
 
ssh-agent
 
ssh-agent
 
ssh-add
 
ssh-add
<pre>
+
</pre>
 
then enter your password for the ssh key.  This step needs to be rebooted each time you log into the Raspberry Pi.
 
then enter your password for the ssh key.  This step needs to be rebooted each time you log into the Raspberry Pi.
  
  * Then use the ssh read and write link from the github repository, e.g.:
+
* Then use the ssh read and write link from the github repository, e.g.:
 
+
<pre>
 
git clone git@github.com:someorg/reponame.git  
 
git clone git@github.com:someorg/reponame.git  
 
+
</pre>
 
this will create a folder called reponame.  The clone operation clones the repository to the local disk.
 
this will create a folder called reponame.  The clone operation clones the repository to the local disk.

Revision as of 23:43, 4 February 2013

TheMagPi.png

Main Readers Authors Volunteers Sponsors Advertising Translations


Raspberry Pi & github

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.
  • Once you have a github account, on your Raspberry Pi type:
git config --global user.name "John Doe"
git config --global user.email J.Doe@machine.org

where the user name and email address should be replaced with your user name and email address. This is a one time configuration step. These settings are then stored in your ~/.gitconfig file.

  • The easiest way to use the command line tools is via an ssh key pair. Type,
ssh-keygen

to create an ssh key pair and choose a secure password (upper and lower case letters, symbols and numbers without dictionary words). This is a one time configuration step, unless the password needs to be updated in the future.

  • Then go to your github account. Select account preferences. Then select "SSH Keys" from the left-hand menu. Click on "Add SSH key" and add your public key (~/.ssh/id_rsa.pub). This is a one time configuration step, unless the public key needs to be updated (for a password change) or another public key needs to be added.

Using github

  • At the start of an editing session (when you log into the Raspberry Pi), type:
ssh-agent
ssh-add

then enter your password for the ssh key. This step needs to be rebooted each time you log into the Raspberry Pi.

  • Then use the ssh read and write link from the github repository, e.g.:
git clone git@github.com:someorg/reponame.git 

this will create a folder called reponame. The clone operation clones the repository to the local disk.