{{lastupdated_at}} by {{lastupdated_by}} {{>toc}} h1. GitHub repository configuration To prepare for GammaLib development using GutHub you have to perform the following steps (you need to do this only once): # Create a GitHub account # Create a GammaLib fork # Clone your fork to your computer # Connect to the GitHub GammaLib repository # Deleting your master branch (optional) h2. Create your GitHub account If you don’t have a GitHub account, go to the "GitHub page":https://github.com/gammalib, and make one. You then need to configure your account to allow write access - see the Generating SSH keys help on "GitHub Help":https://help.github.com/articles/generating-ssh-keys. h2. Create a GammaLib fork As next step you need to create a fork of gammalib on GitHub. The instructions here are very similar to the instructions at http://help.github.com/fork-a-repo/ - please see that page for more details. We’re repeating some of it here just to give the specifics for the GammaLib project, and to suggest some default names. The following example shows how to fork the GammaLib repository: # Log into your GitHub account. # Goto to https://github.com/gammalib/gammalib # Click on the fork button # Select your username (in this example @jknodlseder@) !fork-gammalib.jpg! After a short pause, you should find yourself at the home page for your own forked copy of GammaLib (in this example https://github.com/jknodlseder/gammalib). h2. Clone your fork to your computer As next step, you have to clone your fork to your computer. Use the command
$ git clone git@github.com:user/gammalib.git
  remote: Counting objects: 22147, done.
  remote: Compressing objects: 100% (4911/4911), done.
  remote: Total 22147 (delta 17346), reused 21980 (delta 17179)
  Receiving objects: 100% (22147/22147), 80.25 MiB | 42 KiB/s, done.
  Resolving deltas: 100% (17346/17346), done.
to clone the GammaLib repository from GitHub. Here, @user@ is your GitHub user name. h2. Connect to the GitHub GammaLib repository Now connect your clone to the GitHub GammaLib repository so that you can fetch upstream modifications from the repo.
$ cd gammalib
$ git remote add upstream git://github.com/gammalib/gammalib.git
@upstream@ here is just the arbitrary name we’re using to refer to the main GammaLib repository. Note that we’ve used @git://@ for the URL rather than @git@@. The @git://@ URL is read only. This means we that we can’t accidentally (or deliberately) write to the upstream repo, and we are only going to use it to merge into our own code. You may verify that the connection has been established with
$ git remote -v
  origin    git@github.com:jknodlseder/gammalib.git (fetch)
  origin    git@github.com:jknodlseder/gammalib.git (push)
  upstream  git://github.com/gammalib/gammalib.git (fetch)
  upstream  git://github.com/gammalib/gammalib.git (push)
Your fork is now set up correctly, and you are ready to hack away. h2. Deleting your master branch It may sound strange, but deleting your own @master@ branch can help reduce confusion about which branch you are on. See "deleting master on github":http://matthew-brett.github.com/pydagogue/gh_delete_master.html for details. To delete the master branch, type
$ git checkout devel
  Already on 'devel'
$ git branch -D master
  error: branch 'master' not found.
$ git push origin :master
  To git@github.com:jknodlseder/gammalib.git
   - [deleted]         master
Don't worry if you get the message @error: branch 'master' not found.@, this just signals that you never checked out the master branch. You may do the same thing with the @release@ and @integration@ branches.