Example Git session - First steps using Git » History » Version 3
Redmine Admin, 02/23/2016 02:01 PM
1 | 1 | Redmine Admin | h1. Example Git session - First steps using Git |
---|---|---|---|
2 | |||
3 | 2 | Redmine Admin | h2. Here's an example on using Git. The very first steps in using Git. |
4 | Please note that you need to adapt the Git repository URL! |
||
5 | In this example the repository is called "itisdb". |
||
6 | 1 | Redmine Admin | |
7 | 2 | Redmine Admin | h2. NOTE: Steps 1-4 needs to be done only once. |
8 | 1 | Redmine Admin | |
9 | In order to use the itisdb git repository you need to follow the steps described here. |
||
10 | https://scm.in.tu-clausthal.de/projects/redmine-git-svn-help/wiki/Resolve_SSL_certificate_error_with_Git |
||
11 | |||
12 | 2 | Redmine Admin | # <cd> into your homedirectory |
13 | # Download the certificate chains |
||
14 | 1 | Redmine Admin | <pre> |
15 | 3 | Redmine Admin | wget "https://pki.pca.dfn.de/tu-clausthal-ca/pub/cacert/chain.txt" |
16 | </pre> |
||
17 | <pre> |
||
18 | 1 | Redmine Admin | --2016-02-23 11:35:35-- https://pki.pca.dfn.de/tu-clausthal-ca/pub/cacert/chain.txt |
19 | Resolving pki.pca.dfn.de (pki.pca.dfn.de)... |
||
20 | Connecting to pki.pca.dfn.de (pki.pca.dfn.de):443... connected. |
||
21 | HTTP request sent, awaiting response... 200 OK |
||
22 | Length: 5330 (5.2K) [text/plain] |
||
23 | Saving to: 'chain.txt' |
||
24 | |||
25 | chain.txt 100%[======================================================>] 5.21K --.-KB/s in 0s |
||
26 | |||
27 | 2016-02-23 11:35:35 (49.0 MB/s) - 'chain.txt' saved [5330/5330] |
||
28 | </pre> |
||
29 | <pre> |
||
30 | wget "http://curl.haxx.se/ca/cacert.pem" |
||
31 | 3 | Redmine Admin | </pre> |
32 | <pre>--2016-02-23 11:35:51-- http://curl.haxx.se/ca/cacert.pem |
||
33 | 1 | Redmine Admin | Resolving curl.haxx.se (curl.haxx.se)... |
34 | Connecting to curl.haxx.se (curl.haxx.se):80... connected. |
||
35 | HTTP request sent, awaiting response... 301 Moved Permanently |
||
36 | Location: https://curl.haxx.se/ca/cacert.pem [following] |
||
37 | --2016-02-23 11:35:51-- https://curl.haxx.se/ca/cacert.pem |
||
38 | Connecting to curl.haxx.se (curl.haxx.se):443... connected. |
||
39 | HTTP request sent, awaiting response... 200 OK |
||
40 | Length: 252451 (247K) |
||
41 | Saving to: 'cacert.pem' |
||
42 | |||
43 | cacert.pem 100%[======================================================>] 246.53K 1.54MB/s in 0.2s |
||
44 | |||
45 | 2016-02-23 11:35:52 (1.54 MB/s) - 'cacert.pem' saved [252451/252451] |
||
46 | </pre> |
||
47 | 2 | Redmine Admin | # Append the TU-Clausthal-DFN chain to curls cacerts |
48 | 1 | Redmine Admin | <pre> |
49 | cat cacert.pem chain.txt > TUC-DFN-chain.pem |
||
50 | </pre> |
||
51 | 2 | Redmine Admin | # Create (or edit) a new file in your home directory called '.gitconfig' and insert |
52 | 1 | Redmine Admin | <pre> |
53 | 2 | Redmine Admin | [http] |
54 | sslCAInfo = /home/USERNAME/TUC-DFN-chain.pem |
||
55 | </pre> |
||
56 | # Now that git knows the TU-Clausthal-DFN certificate chain you need to clone the itisdb repository on before you can add own files or chagesets. |
||
57 | <pre> |
||
58 | 1 | Redmine Admin | git clone https://scm.in.tu-clausthal.de/git/itisdb |
59 | </pre> |
||
60 | 2 | Redmine Admin | # Change into the <itisdb> directory to use the following commands. |
61 | 1 | Redmine Admin | Now that you've cloned your working copy you can add files or changes to your local repository (just copy the new files into the freshly cloned itisdb directroy). |
62 | Tell the itisdb repository that you've added/changed something with these commands |
||
63 | For single files or directories you changed use |
||
64 | <pre> |
||
65 | git add <filename> |
||
66 | </pre> |
||
67 | To add all files/changes you made use |
||
68 | <pre> |
||
69 | git add * |
||
70 | </pre> |
||
71 | 2 | Redmine Admin | # Now commit your changes to the HEAD of your local repository |
72 | 1 | Redmine Admin | <pre> |
73 | 2 | Redmine Admin | git commit -m "Insert a meaningful commit message right here!" |
74 | 1 | Redmine Admin | </pre> |
75 | 2 | Redmine Admin | # Finally push everything into the itisdb repository with |
76 | 1 | Redmine Admin | <pre> |
77 | git push origin master |
||
78 | </pre> |
||
79 | 2 | Redmine Admin | # Please update your local repository before start working on it with |
80 | 1 | Redmine Admin | <pre> |
81 | git pull |
||
82 | </pre> |
||
83 | |||
84 | |||
85 | For further documentation use these links: |
||
86 | http://gitref.org/ |
||
87 | http://git-scm.com/docs |