Work with GitHub - E1039-Collaboration/e1039-wiki GitHub Wiki
We choose to host our main repository on GitHub. A few steps to get you started there in order to receive and update software:
- Sign up a GitHub account: so they know who you are.
- Email Abinash Pun your GitHub username: so we know that this account belong to you. Then we will invite you to join the E1039 collaboration on GitHub and grant write access of the analysis repository to your account.
- [Optional]: Send your SSH public key to GitHub: talk to GitHub without bothering with username/password again by using the SSH keys
make yourself known to git
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Done! For example, you can now checkout the analysis repository, edit it and send the updated version back to the repository:
git clone [email protected]:E1039-Collaboration/e1039-analysis.git
cd e1039-analysis
git add ... # add your new files
git commit .... # commit your change to local git repository, so git know that you are done with the update
git push origin master # send the update to GitHub analysis repository
E1039 uses git for code management. It is hosted by github.com under the E1039-collaboration organization.
- e1039-analysis: which contains the analysis modules. Everyone who is a collaborator (To join, email Abinash Pun your GitHub username) can update this repository directly.
- e1039-core: which contains the framework, the G4 simulation and the Event library to read raw data. Please follow this procedure to update coresoftware via mechanism called Pull Requests.
To fetch them for the first time use one of the follow commands:
git clone [email protected]:E1039-Collaboration/<repository>.git; # recommended, if you setup ssh public key following the last section
git clone https://github.com/E1039-Collaboration/<repository> # alternative, will ask for username/password when submitting updates
after the initial cloning a
git pull
will update your local copy.
Hint: quickly navigate through the E1039 software using this tool: Doxygen software reference: a digested reference website for E1039 core software.
The E1039 code is split into two parts:
- Static external packages which are needed to run it (e.g. root, Geant4,...) are located under /e906/app/software/osg/users/yuhw/e1039/externals.
- Our own software /e906/app/software/osg/users/yuhw/e1039/offline_main (once set up the environment variable
OFFLINE_MAIN
points to it)
If you are unfamilar with git, the web has many resources describing git commands. Here's one: http://gitref.org.
show your git configuration
git config --list
it never happens but in case you have to replace your local changes with the original
git checkout -- <filename>
there seems to be no direct way to update your github fork with the master repository. You have to pull the changes into your local repository and then push those changes to your fork. I assume you have set up your local repository that the master is your fork and upstream points to the master repository
Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:
git fetch upstream
Make sure that you're on your master branch:
git checkout master
Rewrite your master branch so that any commits of yours that aren't already in upstream/master are replayed on top of that other branch:
git rebase upstream/master
finally push this to your fork
git push -f origin master