Skip to content

Using Geant4UCN from Github

rayrios edited this page Nov 5, 2012 · 6 revisions

Welcome to Geant4UCN

This page is to help those that are using Geant4UCN and are new to Git and Github. This will serve as a general guideline for how commits to the public version of Geant4UCN code will move forward. Here are the options that are available to you the user.

User 1: You have never used Geant4UCN before and would like to start using it. You have two options

  1. Download the tarfile. (use the zip button found on the code page) This is simple and this webpage would act as any other repository and all your future work stays privately on your computer. If you would like to contribute and receive new changes from other users on github this is not recommended. To add to the code on github you or the administrator would have to manually parse through the code and copy your changes onto the main code. Also, you cannot get new updates from github without completely copying over all your work on your private computer. (You could number every new download of the tarfile as new version and then add your private changes to it manually but that's a lot of work!)

  2. Use Git. This works to easily pull and send updates to the repository.

  • You must first install git onto your computer.
  • Next go to the folder that you wish to download Geant4UCN
  • Type "git clone git://github.com/rayrios/Geant4UCN.git"

You now have geant4UCN onto you computer with git.

  • If there are any new changes made on github, you can type "git pull" which will pull new changes from github to your computer
  • Currently there are two branches depending on which version Geant4 you are running.
  • For Geant4.9.2 type "git checkout Geant4.9.2"
  • For Geant4.9.5 type "git checkout master" (this is the default but if you go to the branch Geant4.9.2 you can come back to Geant4.9.5 by typing this command)

You can then select which changes you want added to your local code.

User 2: You have a version of Geant4UCN code on your computer but do not use or want to use git in the future. Options

  1. You can copy and paste your changes to and from the github repository manually through the website. (you will need github account) By doing this you cause a "fork" to be created. This fork is your own branch that can only be changed by the administrators of that fork. These include the original creator and those that the original creator allows to be administrators on that fork. To edit code and begin a fork, open up one of the files and press "edit". A fork will automatically be generated for you.

  2. You download the tar file and do all of the work of cutting and pasting on your local computer and use for example the "diff" command to help you sort through the differences between the versions.

User 3: You have Geant4UCN and have not been using git but would like to in the future.

Your code will need to be parsed with git.

(still under construction)

User 4: You have Geant4UCN and have been using git.

Your history should be branched (or forked) from the latest common source of code (mostlikely it will be at the starting point of the history on github). Your history will show up on github and you can start to merge or cherry-pick commits to your branch.

For all users: The current code on Github has a simple detector construction geometry. A guide with a magnetic field and thin window. Future branches may include the example UCN code Ex1-Ex4. A separate page will be made for how to separate private code on your computer from the public code made available on Github.

Clone this wiki locally