Git: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
(Replaced content with " This page is obsolete, please see GitHubWorkflow")
Tag: Replaced
 
(79 intermediate revisions by 5 users not shown)
Line 1: Line 1:


==Introduction==
This page is obsolete, please see [[GitHubWorkflow]]
The primary source code management system for the Mu2e Offline software is a [http://git-scm.com/ git] repository that is hosted on the Fermilab [https://cdcvs.fnal.gov/redmine Redmine] site.  Git is a popular open-source software version control system and Redmine is a software project management system which contains, for each project, a wiki, gantt charts, and a bug tracking along with the git respositories.
 
Biased on the git repository's url, you can check out code, and, if you are a code developer, check in modifications. 
'''NB''', when committing code, please follow these [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Git_Workflow_for_Mu2e mu2e conventions] only.  Git also has capabilities for tagging code, tracking history and supports splitting off and merging development branches, among many other features.
 
Some older parts of Mu2e software is managed using [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Revision_Control_Systems other source code management systems].  Some code, both critical and specialized, is in other, smaller repositories.  See [[#Repositories]] below for more details on repositories.
 
See [[#References|the references]] for more details on Redmine and git.
 
==Quick Start==
Please also see the basic [[CodeRecipe|code recipe]] for an introduction to setting up the environment, checking out code and building.
 
If you are going to commit anything, you must understand and follow the [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Git_Workflow_for_Mu2e mu2e commit instructions]
 
If this is the first time you are using git in the mu2e environment, please follow the few steps listed [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Introduction_to_git here under "Configure git"] in order to set up your ~.gitconfig.
 
A more detailed introduction to mu2e repositories is [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Revision_Control_Systems mu2e here].
 
* checkout the main repository
** readonly: <pre>git clone http://cdcvs.fnal.gov/projects/mu2eofflinesoftwaremu2eoffline/Offline.git</pre>
** with kerberos authentication for committing code <pre>git clone ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline/Offline.git</pre>
* checkout the head to a local working branch (recommended)
<pre>git checkout -b work</pre>
* see the history of a file
<pre>git log fileSpec</pre>
* list tags
<pre>git tag -l</pre>
* checkout a tag or branch into the working area
<pre>git checkout tagOrBranchName </pre>
* update the local repository
<pre>git fetch</pre>
* update the local repository and checkout the head into the working area
<pre>git pull</pre>
* see what the status is
<pre>git status</pre>
* command line help
<pre>git status help</pre>
* git browser (to see a graphical history of commits)
<pre>gitk --all</pre>
 
 
Please see the references below or many web resources for details on git concepts, commands and features.
If you are going to commit anything, you must understand and follow the [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Git_Workflow_for_Mu2e mu2e commit instructions]
 
==Repositories==
 
Almost all of the mu2e Offline code is currently in one [https://cdcvs.fnal.gov/redmine/projects/mu2e Redmine repository].
One important piece, the [[BTrk]] UPS product, which contains our Kalman track fit code, is stored in the [https://github.com/KFTrack/BTrk BTrk github repo]. 
 
A git repository is accessed through a url.  For example this is the read/write url for the main offline code respository
ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline/Offline.git
There exist several other mu2e Redmine repositories for various standalone tools not tightly coupled to compiled Offline code.  You can browse [https://cdcvs.fnal.gov/redmine/projects all Redmine projects] and
[https://cdcvs.fnal.gov/redmine/projects/mu2e mu2e Redmine].  The mu2e Redmine has subprojects (and sub-subprojects) and each has a repository associated with them.  For example in the [https://cdcvs.fnal.gov/redmine/projects/standalone Standalone] subproject, there is a sub-subproject '''[https://cdcvs.fnal.gov/redmine/projects/mu2eccfc Mu2eCCFC]''' with repo url:
ssh://p-mu2eccfc@cdcvs.fnal.gov/cvs/projects/mu2eccfc-mu2eccfc/mu2eccfc.git
In addition, the main mu2e Offline repository has sub-repositories which can be seen on the right sidebar menu on the repository [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/repository main page].  An example is the '''dhtools''' sub-repo, which has url:
ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline-dhtools/dhtools.git
 
Here is a (possibly incomplete) list of the smaller repositories.
{|style="width: 100%"
|-
|style="width:10%"|'''Name'''
|style="width:20%"|'''Content'''
|style="width:80%"|'''url'''
|-
|  BTrk || Kalman code || <span style="font-size:70%"><nowiki>https://github.com/KFTrack/BTrk</nowiki></span>
|-
|  mu2egrid || [[MCProdWorkflow|mu2eprodsys]] || <span style="font-size:70%"><nowiki>ssh://p-mu2eccfc@cdcvs.fnal.gov/cvs/projects/mu2eccfc-mu2egrid/mu2egrid.git</nowiki></span>
|-
|  Mu2eCCFC || F-C limit setting || <span style="font-size:70%"><nowiki>ssh://p-mu2eccfc@cdcvs.fnal.gov/cvs/projects/mu2eccfc-mu2eccfc/mu2eccfc.git</nowiki></span>
|-
|  dhtools || [[FileTools|Data Handling]] || <span style="font-size:70%"><nowiki>ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline-dhtools/dhtools.git</nowiki></span>
|-
| codetools  || [[Jenkins]] scripts || <span style="font-size:70%"><nowiki>ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline-codetools/codetools.git</nowiki></span>
|-
|  geomdisplay || Tutorial || <span style="font-size:70%"><nowiki>ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline-geomdisplay/geomdisplay.git</nowiki></span>
|-
|  satellite  || Satellite builds || <span style="font-size:70%"><nowiki>ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline-satellite/satellite.git</nowiki></span>
|-
|}
 
Creating a Redmine subproject is done by the "add subproject" button on the Redmine project web page.
Creating a sub-repository associated to the main offline repo is explained in the
[https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Making_a_git_repository_in_redmine mu2e instructions] and
[https://cdcvs.fnal.gov/redmine/projects/fermi-redmine/wiki/CreatingRepositories SCD instructions].
 
==References==
*[https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Revision_Control_Systems mu2e git and CVS]
*[https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki/Git_Workflow_for_Mu2e mu2e git commit instructions]
*[http://git-scm.com/ git home]  [http://git-scm.com/doc  Documentation] [https://git-scm.com/docs reference]
*[https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/repository redmine repository browser]
*[https://cdcvs.fnal.gov/redmine Fermilab redmine]
*[http://mu2e-docdb.fnal.gov:8080/cgi-bin/ShowDocument?docid=4527Andrei's talk] at the Software and Simulation Meeting, Sept 17, 2014.
*[https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/Marc's_suggested_git_workflow Marc P's suggested git workflow] for simple git projects
*[https://cdcvs.fnal.gov/redmine/projects/fermi-redmine/wiki/GitWorkshop Fermilab git workshop] and related materials
*[https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/wiki managing and creating] new redmine repositories
 
[[Category:Computing]]
[[Category:Code]]
[[Category:CodeManagement]]

Latest revision as of 20:11, 13 May 2021

This page is obsolete, please see GitHubWorkflow