fill in intro-to-git page
[arvados.git] / doc / user / intro-git.md
1 ---
2 layout: default
3 navsection: userguide
4 title: "Intro: git"
5 navorder: 4
6 ---
7
8 # Intro: git
9
10 Git is a revision control system. There are lots of resources for
11 learning about git (try [Try Git](http://try.git.io) or [Top 10 Git
12 Tutorials for
13 Beginners](http://sixrevisions.com/resources/git-tutorials-beginners/)). Here
14 we just cover the specifics of using git in the Arvados environment.
15
16 ### Find your repository
17
18 Go to Workbench → Access → Repositories.
19
20 [https://workbench.{{ site.arvados_api_host }}/repositories](https://workbench.{{ site.arvados_api_host }}/repositories)
21
22 The "push_url" column will contain a string like `git@git.{{ site.arvados_api_host }}:example.git`.
23
24 This url can be used to pull and push commits between your Arvados
25 hosted repository and your VM/workstation.
26
27 ### Make sure your SSH credentials are available
28
29 Git requires you to authenticate with your SSH private key. The best
30 way to make this happen from a VM is to use SSH agent forwarding.
31
32 When you log in to your VM, use the `-A` flag in your `ssh` command,
33 like this:
34
35     ssh -A shell.q
36
37 At the shell prompt in the VM, type `ssh-add -l` to display a list of
38 keys that can be used. You should see something like this:
39
40     2048 a7:f0:fb:ad:ba:66:fd:c2:8e:58:49:3b:6b:2a:1f:c3 example@host (RSA)
41
42 ### Clone your repository
43
44 This step copies your Arvados-hosted repository to a new directory on
45 your VM.
46
47 Log in to your VM (using `ssh -A`!) and type:
48
49     git clone git@git.{{ site.arvados_api_host }}:EXAMPLE.git
50
51 (Replace "EXAMPLE" with your own repository's name, or just copy the
52 usage example shown on the Repositories page.)
53
54 ### Commit to your repository
55
56 This part works just like any other git tree.
57
58     # (edit foo.txt)
59     git add foo.txt
60     git commit -m "Added section explaining what foo isn't"
61
62 ### Push your commits to Arvados
63
64 From within your source tree, type:
65
66     git push
67