4 <h1><a name=
"git" id=
"git">Git
</a></h1>
9 <a href=
"http://git-scm.com/" class=
"urlextern" title=
"http://git-scm.com/" rel=
"nofollow">Git
</a>:
<a href=
"http://en.wikipedia.org/wiki/Git_(software)" class=
"interwiki iw_wp" title=
"http://en.wikipedia.org/wiki/Git_(software)">Git
</a> <br/>
12 <div class=
"plugin_uparrow">
13 <a href=
"#" title=
"Back to top">
14 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
19 <!-- SECTION "Git" [1-78] -->
20 <h2><a name=
"how_to_install_git" id=
"how_to_install_git">How to install Git
</a></h2>
22 <pre class=
"code bash">$
<span class=
"kw2">sudo
</span> <span class=
"kw2">apt-get
</span> <span class=
"kw2">install
</span> git-core
23 $ git config
<span class=
"re5">--global
</span> user.name user_name
24 $ git config
<span class=
"re5">--global
</span> user.email you
<span class=
"sy0">@
</span>yourdomain.example.com
</pre>
25 <div class=
"plugin_uparrow">
26 <a href=
"#" title=
"Back to top">
27 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
32 <!-- SECTION "How to install Git" [79-264] -->
33 <h2><a name=
"how_to_create_a_ssh_key" id=
"how_to_create_a_ssh_key">How to create a SSH key
</a></h2>
35 <pre class=
"code bash">$
<span class=
"kw2">ssh-keygen
</span></pre>
36 <div class=
"plugin_uparrow">
37 <a href=
"#" title=
"Back to top">
38 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
43 <!-- SECTION "How to create a SSH key" [265-336] -->
44 <h2><a name=
"how_to_create_a_project" id=
"how_to_create_a_project">How to create a project
</a></h2>
49 Using
<a href=
"http://repo.or.cz" class=
"urlextern" title=
"http://repo.or.cz" rel=
"nofollow">Repo Public Git Hosting
</a>
51 <pre class=
"code bash">$
<span class=
"kw3">cd
</span> path
<span class=
"sy0">/
</span>to
<span class=
"sy0">/
</span>project
54 $ git commit
<span class=
"re5">-a
</span> <span class=
"re5">-m
</span><span class=
"st0">"message
"</span>
55 $ git remote add origin
<span class=
"kw2">ssh
</span>:
<span class=
"sy0">//
</span>user_name
<span class=
"sy0">@
</span>repo.or.cz
<span class=
"sy0">/
</span>srv
<span class=
"sy0">/
</span>git
<span class=
"sy0">/
</span>project_name.git
56 $ git push
<span class=
"re5">--all
</span> origin
</pre>
59 Using
<a href=
"https://github.com/" class=
"urlextern" title=
"https://github.com/" rel=
"nofollow">GitHub
</a>
61 <pre class=
"code bash">$
<span class=
"kw2">mkdir
</span> project_name
62 $
<span class=
"kw3">cd
</span> project_name
64 $
<span class=
"kw2">touch
</span> README
66 $ git commit
<span class=
"re5">-m
</span> <span class=
"st_h">'first commit'
</span>
67 $ git remote add origin git
<span class=
"sy0">@
</span>github.com:user_name
<span class=
"sy0">/
</span>project_name.git
68 $ git push origin master
</pre>
69 <div class=
"plugin_uparrow">
70 <a href=
"#" title=
"Back to top">
71 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
76 <!-- SECTION "How to create a project" [337-882] -->
77 <h2><a name=
"how_to_download_a_project" id=
"how_to_download_a_project">How to download a project
</a></h2>
82 Using
<a href=
"http://repo.or.cz" class=
"urlextern" title=
"http://repo.or.cz" rel=
"nofollow">Repo Public Git Hosting
</a>
84 <pre class=
"code bash">$ git clone git:
<span class=
"sy0">//
</span>repo.or.cz
<span class=
"sy0">/
</span>project_name.git
85 $
<span class=
"kw3">cd
</span> project_name
</pre>
88 Using
<a href=
"https://github.com/" class=
"urlextern" title=
"https://github.com/" rel=
"nofollow">GitHub
</a>
90 <pre class=
"code bash">$ git clone http:
<span class=
"sy0">//
</span>github.com
<span class=
"sy0">/
</span>user_name
<span class=
"sy0">/
</span>project_name.git
91 $
<span class=
"kw3">cd
</span> project_name
</pre>
92 <div class=
"plugin_uparrow">
93 <a href=
"#" title=
"Back to top">
94 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
99 <!-- SECTION "How to download a project" [883-1193] -->
100 <h2><a name=
"how_to_upload_a_project" id=
"how_to_upload_a_project">How to upload a project
</a></h2>
109 Using
<a href=
"http://repo.or.cz" class=
"urlextern" title=
"http://repo.or.cz" rel=
"nofollow">Repo Public Git Hosting
</a>
111 <pre class=
"code bash">$ git remote
<span class=
"kw2">rm
</span> origin
112 $ git remote add origin
<span class=
"kw2">ssh
</span>:
<span class=
"sy0">//
</span>user_name
<span class=
"sy0">@
</span>repo.or.cz
<span class=
"sy0">/
</span>srv
<span class=
"sy0">/
</span>git
<span class=
"sy0">/
</span>project_name.git
</pre>
115 Using
<a href=
"https://github.com/" class=
"urlextern" title=
"https://github.com/" rel=
"nofollow">GitHub
</a>
117 <pre class=
"code bash">$ git remote
<span class=
"kw2">rm
</span> origin
118 $ git remote add origin git
<span class=
"sy0">@
</span>github.com:user_name
<span class=
"sy0">/
</span>project_name.git
</pre>
124 <pre class=
"code bash">$ git add .
125 $ git commit
<span class=
"re5">-a
</span> <span class=
"re5">-m
</span><span class=
"st0">"description of the modifications
"</span>
126 $ git push
<span class=
"re5">--all
</span> origin
</pre>
127 <div class=
"plugin_uparrow">
128 <a href=
"#" title=
"Back to top">
129 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
134 <!-- SECTION "How to upload a project" [1194-1691] -->
135 <h2><a name=
"how_to_update_your_version_of_a_project" id=
"how_to_update_your_version_of_a_project">How to update your version of a project
</a></h2>
137 <pre class=
"code bash">$ git pull origin master
</pre>
138 <div class=
"plugin_uparrow">
139 <a href=
"#" title=
"Back to top">
140 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
145 <!-- SECTION "How to update your version of a project" [1692-1792] -->
146 <h2><a name=
"how_to_create_a_tag" id=
"how_to_create_a_tag">How to create a tag
</a></h2>
148 <pre class=
"code bash">$ git tag tag_name
</pre>
149 <div class=
"plugin_uparrow">
150 <a href=
"#" title=
"Back to top">
151 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
156 <!-- SECTION "How to create a tag" [1793-1865] -->
157 <h2><a name=
"how_to_upload_a_tag" id=
"how_to_upload_a_tag">How to upload a tag
</a></h2>
159 <pre class=
"code bash">$ git push origin tag_name
</pre>
164 <pre class=
"code bash">$ git push
<span class=
"re5">--tags
</span> origin
</pre>
165 <div class=
"plugin_uparrow">
166 <a href=
"#" title=
"Back to top">
167 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
172 <!-- SECTION "How to upload a tag" [1866-1996] -->
173 <h2><a name=
"git_cheat_sheet" id=
"git_cheat_sheet">Git Cheat Sheet
</a></h2>
178 <a href=
"http://cheat.errtheblog.com/s/git?utm_source=twitter&utm_medium=micro-blog&utm_campaign=twitter" class=
"urlextern" title=
"http://cheat.errtheblog.com/s/git?utm_source=twitter&utm_medium=micro-blog&utm_campaign=twitter" rel=
"nofollow">Cheat Git
</a>
180 <div class=
"plugin_uparrow">
181 <a href=
"#" title=
"Back to top">
182 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
187 <!-- SECTION "Git Cheat Sheet" [1997-2136] -->
188 <h2><a name=
"resumo_em_portugues" id=
"resumo_em_portugues">Resumo em português
</a></h2>
190 <pre class=
"code bash">Tens que te cadastrar no github e me dizer teu usuário para poderes dar pull
192 http:
<span class=
"sy0">//
</span>github.com
<span class=
"sy0">/
</span>kssilveira
<span class=
"sy0">/
</span>CTipsAndTricks
194 chave
<span class=
"kw2">ssh
</span>:
195 <span class=
"kw2">cat
</span> ~
<span class=
"sy0">/
</span>.ssh
<span class=
"sy0">/
</span>id_rsa.pub
196 caso o arquivo exista, coloca o conteú
<span class=
"kw1">do
</span> dele na tua lista de chaves
<span class=
"kw2">ssh
</span> no teu perfil
<span class=
"kw1">do
</span> git hub
198 <span class=
"kw2">ssh-keygen
</span>
199 <span class=
"br0">{</span>enter
<span class=
"br0">}</span>
201 goto chave
<span class=
"kw2">ssh
</span>
203 git config
<span class=
"re5">--global
</span> user.name
<span class=
"st0">"Bruno Jurkovski
"</span>
204 git config
<span class=
"re5">--global
</span> user.email bjurkovski
<span class=
"sy0">@
</span>gmail.com
205 git clone git
<span class=
"sy0">@
</span>github.com:kssilveira
<span class=
"sy0">/
</span>CTipsAndTricks.git
208 ...
<span class=
"kw2">make
</span> clean nas pastas com os slides ... apagar
<span class=
"sy0">*
</span>~,
<span class=
"sy0">*
</span>.o, executáveis e etc. de todas
<span class=
"kw2">as
</span> pastas ...
210 ... ver se tem apenas arquivos que não são derivados
<span class=
"br0">(</span>além dos pdfs
<span class=
"br0">)</span> ...
213 ... verificar novamente ...
214 git commit
<span class=
"re5">-a
</span> <span class=
"re5">-m
</span><span class=
"st0">"descrição
"</span>
215 ... isso cria uma versão
<span class=
"kw3">local
</span> <span class=
"br0">(</span>só na tua máquina
<span class=
"br0">)</span>, que funciona da mesma forma que se tivesse no servidor ...
216 git push
<span class=
"re5">--all
</span> origin
217 ... upload para o servidor ...
218 git pull origin master
219 ... download
<span class=
"kw1">do
</span> servidor ...
</pre>
220 <div class=
"tags"><span>
221 <a href=
"/~kssilveira/site/doku.php?id=tag:programming&do=showtag&tag=tag%3Aprogramming" class=
"wikilink1" title=
"tag:programming" rel=
"tag">programming
</a>
223 <div class=
"plugin_uparrow">
224 <a href=
"#" title=
"Back to top">
225 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
230 <!-- SECTION "Resumo em português" [2137-] -->