<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mauricio de Amorim &#187; GitHub</title>
	<atom:link href="http://mauriciodeamorim.com.br/tag/github/feed/" rel="self" type="application/rss+xml" />
	<link>http://mauriciodeamorim.com.br</link>
	<description>Tecnologia e desenvolvimento web</description>
	<lastBuildDate>Tue, 21 Feb 2012 22:09:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Git &#8211; Removendo tags do repositório</title>
		<link>http://mauriciodeamorim.com.br/2010/08/09/git-removendo-tags-do-repositorio/</link>
		<comments>http://mauriciodeamorim.com.br/2010/08/09/git-removendo-tags-do-repositorio/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 10:44:39 +0000</pubDate>
		<dc:creator>Mauricio de Amorim</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>

		<guid isPermaLink="false">http://mauriciodeamorim.com.br/?p=725</guid>
		<description><![CDATA[Uma forma de criar uma marcação no Git seja para documentar uma modificação importante ou para marcar uma versão é usar o comando “tag”. Caso você se depare com o problema de remover uma tag criada acidentalmente no repositório fica aqui a dica de como corrigir. Imaginando que após alguns commits queremos criar uma tag [...]]]></description>
			<content:encoded><![CDATA[<p>Uma forma de criar uma marcação no Git seja para documentar uma modificação importante ou para marcar uma versão é usar o comando “tag”. Caso você se depare com o problema de remover uma tag criada acidentalmente no repositório fica aqui a dica de como corrigir.</p>
<p>Imaginando que após alguns commits  queremos criar uma tag fariamos isto:</p>
<pre style="background-color: black; color: white">
<span style="color: yellow">git tag -a beta0.1 -m “Primeira versão beta”</span>
</pre>
<p>Continuamos trabalhando e após mais alguns commits fazemos novamente:</p>
<pre style="background-color: black; color: white">
git add . &#038; git commit -am “Incluindo arquivo README”
<span style="color: yellow">git tag -a beta1.0 -m “Mais uma versão beta” </span>
git push origin master
<span style="color: yellow">git push --tags</span>
Counting objects: 6, done.
...
To git@github.com:mauriciodeamorim/testes_com_tags.git
 * [new tag]     	<span style="color: green">beta0.1 -> beta0.1</span>
 * [new tag]     	<span style="color: red">beta1.0 -> beta1.0</span>
</pre>
<p>Aqui cometemos o erro de criar outra tag numa sequência diferente da inicial e enviamos ao repositório.</p>
<p>Olhando nossa árvore no Gitk temos:</p>
<p style="padding: 20px;">
<img src="http://mauriciodeamorim.com.br/wp-content/uploads/2010/08/gitk_tags_wrong.png" alt="" title="gitk_tags_wrong" width="424" height="65" class="aligncenter size-full wp-image-729" /><br />
</span></p>
<p>Em nosso repositório no GitHub ficou assim:</p>
<p style="padding: 20px;">
<img src="http://mauriciodeamorim.com.br/wp-content/uploads/2010/08/github_two_tags.png" alt="" title="github_two_tags" width="360" height="92" class="aligncenter size-full wp-image-727" /><br />
</span></p>
<p>Então vamos considerar que a tag válida é a primeira “beta0.1” , então apagaremos a tag beta1.0 do repositório e depois localmente.</p>
<pre style="background-color: black; color: white">
git push origin :beta1.0
git tag -d beta1.0
</pre>
<p>Agora olhando tanto para o GitK quanto para o repositório temos tudo em ordem novamente.</p>
<p style="padding: 20px;">
<img src="http://mauriciodeamorim.com.br/wp-content/uploads/2010/08/gitk_tags_ok.png" alt="" title="gitk_tags_ok" width="428" height="65" class="aligncenter size-full wp-image-728" />
</p>
<p style="padding: 20px;">
<img src="http://mauriciodeamorim.com.br/wp-content/uploads/2010/08/github_one_tag_b.png" alt="" title="github_one_tag_b" width="360" height="92" class="aligncenter size-full wp-image-726" />
</p>
<p><b>Outros comandos</p>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td>Envia uma tag de cada vez ao repositório</td>
<td>git push origin beta0.1</td>
</tr>
<tr>
<td>Envia todas as tags ao repositório</td>
<td>git push  &#8211; - tags</td>
</tr>
<tr>
<td>Envia commits e tags de uma só vez ao repositório</td>
<td>git push origin master  &#8211; - tags</td>
</tr>
<tr>
<td>Lista as tags existentes</td>
<td>git tag</td>
</tr>
<tr>
<td>Descreve a tag e quantos commits temos após ela</td>
<td>git describe</td>
</tr>
<tr>
<td>Mostra a tag e commit detalhadamente</td>
<td>git show beta0.1</td>
</tr>
<tr>
<td>Mostra a tag detalhadamente</td>
<td>git tag -v beta0.1</td>
</tr>
</table>
<p><b>Referências:</b><br />
<a href="http://gitready.com" target="_blank">Git Ready</a><br />
<a href="http://help.github.com/remotes/" target="_blank">Github &#8211; Working with remotes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mauriciodeamorim.com.br/2010/08/09/git-removendo-tags-do-repositorio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Manipulando branches remotos com Git</title>
		<link>http://mauriciodeamorim.com.br/2010/07/12/manipulando-branches-remotos-git/</link>
		<comments>http://mauriciodeamorim.com.br/2010/07/12/manipulando-branches-remotos-git/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 04:51:14 +0000</pubDate>
		<dc:creator>Mauricio de Amorim</dc:creator>
				<category><![CDATA[Dicas rápidas]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>

		<guid isPermaLink="false">http://mauriciodeamorim.com.br/?p=707</guid>
		<description><![CDATA[Reorganizando meus projetos no Github me deparei com o problema de ter criado muitos branches locais e remotos e tudo estava uma grande bagunça. Os comandos que me ajudaram a resolver isto foram: Dado os branches locais macos-snow ~/project (master) git branch * master fix_counter rails3-version Para criá-los remotamente use macos-snow ~/project (master) git push [...]]]></description>
			<content:encoded><![CDATA[<p>Reorganizando meus projetos no <a href="http://github.com" target="_blank">Github</a> me deparei com o problema de ter criado muitos branches locais e remotos e tudo estava uma grande bagunça. Os comandos que me ajudaram a resolver isto foram:</p>
<p>Dado os branches locais </p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git branch
* master
  fix_counter
  rails3-version
</pre>
<p>Para criá-los remotamente use</p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git push --all
</pre>
<p>Ou para um branch específico</p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git push origin rails3-version
</pre>
<p>Para apagar branches locais</p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git branch -D rails3-version
</pre>
<p>Para apagar branches remotos</p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git push origin :rails3-version
</pre>
<p>Renomear branches locais</p>
<pre style="background-color: black; color: white">
macos-snow <span style="color: green">~/project</span><span style="color:red"> (master)</span> git branch -m old_branch new_branch
</pre>
<p>As referências que encontrei para renomear branches remotos não me foram úteis por isso fiz da forma mais prática renomeando o branch local, enviando para repositório e apagando o branch remoto antigo.</p>
<p><b>Referências:</b><br />
- <a href="http://help.github.com/remotes/" target="_blank">Help Github</a><br />
- <a href="http://www.gitready.com" target="_blank">Git ready</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mauriciodeamorim.com.br/2010/07/12/manipulando-branches-remotos-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Criando um repositório no Github</title>
		<link>http://mauriciodeamorim.com.br/2009/10/03/criando-um-repositorio-no-github/</link>
		<comments>http://mauriciodeamorim.com.br/2009/10/03/criando-um-repositorio-no-github/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 12:30:09 +0000</pubDate>
		<dc:creator>Mauricio de Amorim</dc:creator>
				<category><![CDATA[Dicas rápidas]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mauriciodeamorim.com.br/blog/?p=7</guid>
		<description><![CDATA[Vou descrever aqui o caminho mais curto para colocar seu projeto em um repositório remoto usando o Github. Crie uma conta no Github. Adicionei sua chave SSH (Linux) copiando o resultado do comando abaixo no campo &#8220;SSH Public Key&#8221;. Veja aqui como configurar em outros sistemas. cat ~/.ssh/id_dsa.pub Se ainda não tem a chave, crie [...]]]></description>
			<content:encoded><![CDATA[<p>Vou descrever aqui o caminho mais curto para colocar seu projeto em um repositório remoto usando o Github.</p>
<p>Crie uma conta no <a href="https://github.com/signup/free" target="_blank">Github</a>.</p>
<p>Adicionei sua chave SSH (Linux) copiando o resultado do comando abaixo no campo &#8220;SSH Public Key&#8221;. Veja <a href="http://github.com/guides/providing-your-ssh-key" target="_blank">aqui</a> como configurar em outros sistemas.</p>
<pre>cat ~/.ssh/id_dsa.pub</pre>
<p>Se ainda não tem a chave, crie e proceda como no item anterior.</p>
<pre>cd  ~/.ssh
ssh-keygen -t rsa -C "seu_email@email.com"
(enter)
(enter)
</pre>
<p>Crie um repositório em <a href="https://github.com/repositories/new" target="_blank">Your Repositories </a> que chamaremos de &#8220;primeiro_projeto&#8221;<br />
Na máquina local,  crie uma pasta chamada primeiro_projeto,  inicie um projeto com o Git e crie um arquivo qualquer para teste:</p>
<pre>mkdir primeiro_projeto
cd primeiro_projeto
git init-db
touch arquivo_qualquer.txt
git add .
git commit -a -m "Primeiro registro de alterações."
</pre>
<p>Vincule o projeto ao repositório no Github digitando:</p>
<pre><code>git remote add origin git@github.com:sua_conta_no_github/primeiro_projeto.git</code></pre>
<p>Envie os arquivos da sua máquina para o repositório:</p>
<pre><code>git push origin master</code></pre>
<p>Confira se o seu repositório foi atualilzado acessando http://github.com/sua_conta_no_github/primeiro_projeto</p>
<p><strong>Referências:</strong><br />
- <a href="http://help.github.com/" target="_blank">help.github.</a></p>
<p><strong>Assuntos relacionados:</strong><br />
- <a href="http://mauriciodeamorim.com.br/2009/01/06/como-usar-git-no-windows/" target="_blank">Como usar o Git no Windows</a><br />
- <a href="http://mauriciodeamorim.com.br/2009/01/09/criando-branches-no-git/" target="_blank">Criando branches no Git</a><br />
- <a href="http://mauriciodeamorim.com.br/2009/07/13/criando-atalhos-no-git/" target="_blank">Criando atalhos no Git</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mauriciodeamorim.com.br/2009/10/03/criando-um-repositorio-no-github/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Criando branches no Git</title>
		<link>http://mauriciodeamorim.com.br/2009/01/09/criando-branches-no-git/</link>
		<comments>http://mauriciodeamorim.com.br/2009/01/09/criando-branches-no-git/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 00:21:03 +0000</pubDate>
		<dc:creator>Mauricio de Amorim</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://mauriciodeamorim.com.br/blog/?p=13</guid>
		<description><![CDATA[0) Instale e configure o Git. 1) No GitHub encontre o Clone URL do projeto. 2) Pelo terminal (Git Bash) entre na pasta onde será criado o projeto (Ex.: C:\projetos) e digite: git clone git://github.com/nome_usuario_github/nome_projeto.git 3) Entre na nova pasta adicionada e crie um branch chamado working: cd nome_projeto git branch working master 4) Alterne [...]]]></description>
			<content:encoded><![CDATA[<p>0) <a title="Instalação do Git no Windows" href="http://mauriciodeamorim.com.br/2009/01/06/como-usar-git-no-windows/" target="_blank">Instale e configure o Git.</a></p>
<p>1) No GitHub encontre o <em><strong>Clone URL</strong></em> do projeto.</p>
<p>2) Pelo terminal (Git Bash) entre na pasta onde será criado o projeto (Ex.: C:\projetos) e digite:</p>
<pre><code>git clone git://github.com/nome_usuario_github/nome_projeto.git</code></pre>
<p>3) Entre na nova pasta adicionada e crie um branch chamado <em><strong>working</strong></em>:</p>
<pre><code>cd nome_projeto
git branch working master</code></pre>
<p>4) Alterne para o branch <em><strong>working</strong></em>:</p>
<pre><code>git checkout working</code></pre>
<p>5) O branch onde estamos aparecerá com asterisco ao digitar:</p>
<pre><code>git branch
  master
* working </code></pre>
<p>6) Crie um arquivo e adicione ao branch:</p>
<pre><code>touch README.txt</code></pre>
<pre><code>git add README.txt</code></pre>
<p>ou</p>
<pre><code>git add .</code></pre>
<p>ou</p>
<pre><code>git add -i</code></pre>
<p>- O primeiro adiciona o arquivo especificado, lembrando que README.txt é diferente de readme.txt.<br />
- O segundo adiciona todos os arquivos modificados, excluídos ou incluídos.<br />
- O terceiro adiciona interativamente(i). Uma lista será exibida para que cada arquivo seja incluído individualmente.</p>
<p>7) Faça o commit das alterações (ainda estamos no branch <em>working</em>) e depois liste os arquivos para ver o que temos:</p>
<pre><code>git commit -m "Primeiro commit no branch working"
ls -la</code></pre>
<p>8 ) Agora volte para o branch <em>master</em> e liste os arquivos:</p>
<pre><code>git checkout master
ls -la</code></pre>
<p>O arquivo README.txt não foi listado. Ele existe apenas no branch <em><strong>working</strong></em>, ou seja, o código original continua intacto.</p>
<p>É possível criar diversos branches e trabalhar uma parte do código em cada um deles sem alterar o branch original e depois juntá-los gradativamente assim que cada alteração fique pronta.</p>
<p><a href="http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png">Consulta rápida dos comandos e fluxo do Git (Cheat Sheet)</a></p>
<p><strong>Referências:</strong><br />
- <a href="http://br.kernelnewbies.org/node/58" target="_blank">Guia rápido para o GIT</a><br />
- <a href="http://www.akitaonrails.com/2008/4/3/micro-tutorial-de-git">Micro Tutorial de Git</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mauriciodeamorim.com.br/2009/01/09/criando-branches-no-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

