Project

General

Profile

Wiki » History » Version 1

Geoffrey Mills, 05/28/2014 04:36 PM

1 1 Geoffrey Mills
h1. GIT repository
2 1 Geoffrey Mills
3 1 Geoffrey Mills
To check out things from the repository you will need a Fermilab services account and a Fermilab kerberos account:
4 1 Geoffrey Mills
5 1 Geoffrey Mills
If you don't have them, go to [[http://computing.fnal.gov/xms/Services/Getting_Started/Introduction_to_Computing_at_Fermilab]] and follow directions.
6 1 Geoffrey Mills
7 1 Geoffrey Mills
Once you have an account, go to [[https://cdcvs.fnal.gov/redmine]], register (button in upper right corner), and/or sign in to redmine.  
8 1 Geoffrey Mills
9 1 Geoffrey Mills
Once you are able to sign into redmine, send Geoffrey Mills (mills@lanl.gov) a message that you would like access to the repository and he can add you to the list. Once authenticated:
10 1 Geoffrey Mills
11 1 Geoffrey Mills
12 1 Geoffrey Mills
-To view the contents:
13 1 Geoffrey Mills
14 1 Geoffrey Mills
click on the "Repository tab":[[https://cdcvs.fnal.gov/redmine/projects/lbne-muon/repository]]
15 1 Geoffrey Mills
16 1 Geoffrey Mills
-To check out the complete contents on Unix or MacOS:
17 1 Geoffrey Mills
18 1 Geoffrey Mills
19 1 Geoffrey Mills
<pre>
20 1 Geoffrey Mills
kinit <username>@FNAL.GOV
21 1 Geoffrey Mills
git clone ssh://p-lbne-muon@cdcvs.fnal.gov/cvs/projects/lbne-muon
22 1 Geoffrey Mills
</pre>
23 1 Geoffrey Mills
24 1 Geoffrey Mills
25 1 Geoffrey Mills
G. Mills September 11, 2012
26 1 Geoffrey Mills
27 1 Geoffrey Mills
Some  web page that explains how to setup and use git repositories on redmine:
28 1 Geoffrey Mills
https://cdcvs.fnal.gov/redmine/projects/fermi-redmine/wiki/CreatingRepositories
29 1 Geoffrey Mills
https://cdcvs.fnal.gov/redmine/projects/fermi-redmine/wiki/Git
30 1 Geoffrey Mills
31 1 Geoffrey Mills
32 1 Geoffrey Mills
There is also a great (and free for us non-commercial efforts) git GUI interface for Mac's, PC's and Unix boxes:
33 1 Geoffrey Mills
SmartGit: http://www.syntevo.com/smartgit/download.html
34 1 Geoffrey Mills
35 1 Geoffrey Mills
36 1 Geoffrey Mills
h2. More on git repositories
37 1 Geoffrey Mills
38 1 Geoffrey Mills
39 1 Geoffrey Mills
If you want to view it:
40 1 Geoffrey Mills
41 1 Geoffrey Mills
https://cdcvs.fnal.gov/redmine/projects/lbne-muon/repository
42 1 Geoffrey Mills
43 1 Geoffrey Mills
44 1 Geoffrey Mills
Some quick start commands:
45 1 Geoffrey Mills
46 1 Geoffrey Mills
1. To create a clone of it on your laptop (I.e. Check it out of the repository):
47 1 Geoffrey Mills
48 1 Geoffrey Mills
> kinit <your principle>@FNAL.GOV
49 1 Geoffrey Mills
> git clone ssh://p-lbne-muon@cdcvs.fnal.gov/cvs/projects/lbne-muon
50 1 Geoffrey Mills
51 1 Geoffrey Mills
That will create a local directory "lbne-muon" which currently contains a README file.
52 1 Geoffrey Mills
53 1 Geoffrey Mills
2. Then optionally make an "alias" for the repository like "fnal-readmine" (instead of typing "ssh://p-lbne-muon@cdcvs.fnal.gov/cvs/projects/lbne-muon" all the time:
54 1 Geoffrey Mills
55 1 Geoffrey Mills
> cd lbne-muon
56 1 Geoffrey Mills
> git remote add fnal-redmine ssh://p-lbne-muon@cdcvs.fnal.gov/cvs/projects/lbne-muon
57 1 Geoffrey Mills
58 1 Geoffrey Mills
3. Then add new files to the directory and do:
59 1 Geoffrey Mills
60 1 Geoffrey Mills
> cp <myfiles....> .
61 1 Geoffrey Mills
> git add  fnal-redmine .
62 1 Geoffrey Mills
> git commit
63 1 Geoffrey Mills
64 1 Geoffrey Mills
That will put them and any changes into your the local repository (the current directory you are in).
65 1 Geoffrey Mills
66 1 Geoffrey Mills
4. You then have to "push" them to the redmine site "ssh://p-lbne-muon-nsf-proposal@cdcvs.fnal.gov/cvs/projects/lbne-muon-nsf-proposal". That allows other people to "pull" your changes from the redmine repository.
67 1 Geoffrey Mills
68 1 Geoffrey Mills
> git push 
69 1 Geoffrey Mills
70 1 Geoffrey Mills
Or alternatively
71 1 Geoffrey Mills
72 1 Geoffrey Mills
> git push fnal-redmine
73 1 Geoffrey Mills
 
74 1 Geoffrey Mills
Or
75 1 Geoffrey Mills
76 1 Geoffrey Mills
> git push ssh://p-lbne-muon@cdcvs.fnal.gov/cvs/projects/lbne-muon
77 1 Geoffrey Mills
 
78 1 Geoffrey Mills
All of the above commands push your changes to the redmine site
79 1 Geoffrey Mills
80 1 Geoffrey Mills
81 1 Geoffrey Mills
5. More information:
82 1 Geoffrey Mills
83 1 Geoffrey Mills
The git users manual is here:
84 1 Geoffrey Mills
85 1 Geoffrey Mills
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
86 1 Geoffrey Mills
87 1 Geoffrey Mills
A tutorial is here:
88 1 Geoffrey Mills
89 1 Geoffrey Mills
http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html