Project

General

Profile

Example Git session - First steps using Git » History » Version 2

Redmine Admin, 02/23/2016 02:00 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 2 Redmine Admin
*wget "https://pki.pca.dfn.de/tu-clausthal-ca/pub/cacert/chain.txt"*
16 1 Redmine Admin
--2016-02-23 11:35:35--  https://pki.pca.dfn.de/tu-clausthal-ca/pub/cacert/chain.txt
17
Resolving pki.pca.dfn.de (pki.pca.dfn.de)... 
18
Connecting to pki.pca.dfn.de (pki.pca.dfn.de):443... connected.
19
HTTP request sent, awaiting response... 200 OK
20
Length: 5330 (5.2K) [text/plain]
21
Saving to: 'chain.txt'
22
23
chain.txt                      100%[======================================================>]   5.21K  --.-KB/s   in 0s     
24
25
2016-02-23 11:35:35 (49.0 MB/s) - 'chain.txt' saved [5330/5330]
26
</pre>
27
<pre>
28
wget "http://curl.haxx.se/ca/cacert.pem"
29
--2016-02-23 11:35:51--  http://curl.haxx.se/ca/cacert.pem
30
Resolving curl.haxx.se (curl.haxx.se)... 
31
Connecting to curl.haxx.se (curl.haxx.se):80... connected.
32
HTTP request sent, awaiting response... 301 Moved Permanently
33
Location: https://curl.haxx.se/ca/cacert.pem [following]
34
--2016-02-23 11:35:51--  https://curl.haxx.se/ca/cacert.pem
35
Connecting to curl.haxx.se (curl.haxx.se):443... connected.
36
HTTP request sent, awaiting response... 200 OK
37
Length: 252451 (247K)
38
Saving to: 'cacert.pem'
39
40
cacert.pem                     100%[======================================================>] 246.53K  1.54MB/s   in 0.2s   
41
42
2016-02-23 11:35:52 (1.54 MB/s) - 'cacert.pem' saved [252451/252451]
43
</pre>
44 2 Redmine Admin
# Append the TU-Clausthal-DFN chain to curls cacerts
45 1 Redmine Admin
<pre>
46
cat cacert.pem chain.txt > TUC-DFN-chain.pem
47
</pre>
48 2 Redmine Admin
# Create (or edit) a new file in your home directory called '.gitconfig' and insert
49 1 Redmine Admin
<pre>
50 2 Redmine Admin
[http]
51
    sslCAInfo = /home/USERNAME/TUC-DFN-chain.pem
52
</pre>
53
# 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.
54
<pre>
55 1 Redmine Admin
git clone https://scm.in.tu-clausthal.de/git/itisdb
56
</pre>
57 2 Redmine Admin
# Change into the <itisdb> directory to use the following commands.
58 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).
59
Tell the itisdb repository that you've added/changed something with these commands
60
For single files or directories you changed use 
61
<pre>
62
git add <filename> 
63
</pre> 
64
To add all files/changes you made use
65
<pre>
66
git add *  
67
</pre> 
68 2 Redmine Admin
# Now commit your changes to the HEAD of your local repository
69 1 Redmine Admin
<pre>
70 2 Redmine Admin
git commit -m "Insert a  meaningful commit message right here!"
71 1 Redmine Admin
</pre>
72 2 Redmine Admin
# Finally push everything into the itisdb repository with
73 1 Redmine Admin
<pre>
74
git push origin master
75
</pre>
76 2 Redmine Admin
# Please update your local repository before start working on it with
77 1 Redmine Admin
<pre>
78
git pull
79
</pre>
80
81
82
For further documentation use these links:
83
http://gitref.org/
84
http://git-scm.com/docs