{"id":505,"date":"2019-10-30T12:14:16","date_gmt":"2019-10-30T15:14:16","guid":{"rendered":"https:\/\/www.gnial.com.br\/gnialhelp\/?p=505"},"modified":"2020-10-28T17:16:44","modified_gmt":"2020-10-28T20:16:44","slug":"git-and-github-basic-functions","status":"publish","type":"post","link":"http:\/\/www.gnial.com.br\/gnialhelp\/git-and-github-basic-functions\/","title":{"rendered":"Git and GitHub &#8211; Basic Functions"},"content":{"rendered":"<h3>Instala\u00e7\u00e3o<\/h3>\n<p><a href=\"https:\/\/www.gnial.com.br\/gnialhelp\/git-and-github\/\">Git and GitHub &#8211; Download<\/a><\/p>\n<h3>Comandos B\u00e1sicos<\/h3>\n<blockquote>\n<pre><strong><span style=\"color: #008080;\">$ git clone URL<\/span><\/strong> (apenas para baixar o projeto)\r\n<strong><span style=\"color: #808000;\">$ git pull<\/span><\/strong> (sempre atualizar o projeto, constantemente)<strong>\r\n<span style=\"color: #800000;\">$ git add <\/span><\/strong><strong><span style=\"color: #800000;\">. <\/span><\/strong>(para enviar os aquivos)\r\n<span style=\"color: #800000;\"><strong>$ git commit -m \"message\"\r\n<\/strong><strong>$ git push<\/strong><\/span><\/pre>\n<\/blockquote>\n<h3>Escolher um local para os reposit\u00f3rios Git<\/h3>\n<p>Crie uma pasta em Documentos chamado &#8220;git&#8221; <em style=\"font-size: 18px;\">(pode ser em qualquer outro local se preferir)<\/em><\/p>\n<blockquote><p>Dentro desta pasta que ser\u00e1 criado reposit\u00f3rios e projetos automaticamente<\/p><\/blockquote>\n<p>Com o bot\u00e3o direito do mouse sobre a pasta que voc\u00ea criou (git) clique na op\u00e7\u00e3o: <strong>&#8220;Git Bash Here&#8221;. Abrir\u00e1 um terminal de comando.<\/strong><\/p>\n<blockquote><p><em>Obs: Lembre-se que o s\u00edmbolo <span style=\"color: #008000;\"><strong>$<\/strong><\/span> \u00e9 refrencia ao terminal, n\u00e3o \u00e9 parte do comando.<\/em><\/p><\/blockquote>\n<h3>Clonar<\/h3>\n<pre><strong>$ git clone URL<\/strong> (url \u00e9 o endere\u00e7o do reposit\u00f3rio)<\/pre>\n<p>Exemplo:<\/p>\n<pre><strong>$ git clone <em>https:\/\/github.com\/<span style=\"color: #808080;\">nomedoautor<\/span>\/projeto<\/em><\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-511 size-full\" src=\"https:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git.png\" alt=\"\" width=\"1035\" height=\"538\" srcset=\"http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git.png 1035w, http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git-300x156.png 300w, http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git-768x399.png 768w, http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git-1024x532.png 1024w, http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git-400x208.png 400w, http:\/\/www.gnial.com.br\/gnialhelp\/wp-content\/uploads\/2019\/10\/url-git-800x416.png 800w\" sizes=\"auto, (max-width: 1035px) 100vw, 1035px\" \/><\/p>\n<h3>Direcionar ao reposit\u00f3rio<\/h3>\n<p>Depois de clonar para sua m\u00e1quina, direcione seu terminal para o local correto. Se o nome da pasta criada \u00e9 <span style=\"color: #ff6600;\"><strong>&#8220;projecto-v1-release&#8221;<\/strong><\/span>, v\u00e1 ao terminal de comando e digite:<\/p>\n<pre><strong>$ cd <span style=\"color: #ff6600;\">projecto-v1-release<\/span><\/strong><\/pre>\n<p>Este comando far\u00e1 voc\u00ea trabalhar dentro do reposit\u00f3rio\/projeto.<\/p>\n<h3>Criando arquivo<\/h3>\n<p>Crie um arquivo de forma abitual dentro da parta. Ou, voc\u00ea pode criar um aquivo pelo terminal:<\/p>\n<pre><strong>$ nano filename.html<\/strong><\/pre>\n<p>Escreva algo dentro, pressione [<strong>Ctrl+X]<\/strong> pra sair, digite <strong>[Y]<\/strong> para salvar a altera\u00e7\u00e3o e [<strong>Enter]<\/strong> para finalizar<\/p>\n<p>Pronto, um arquivo criado atrav\u00e9s do terminal.<\/p>\n<h3>Upload<\/h3>\n<p>Para enviar os aquivos \u00e9 preciso:<\/p>\n<ol>\n<li>Criar um pacote<\/li>\n<li>Comentar<\/li>\n<li>Enviar<\/li>\n<\/ol>\n<pre><span style=\"color: #99cc00;\"><strong>$ git add .<\/strong><\/span> <em>(n\u00e3o esque\u00e7a do ponto, significa all)<\/em>\r\n<span style=\"color: #993366;\"><strong>$ git commit -m \"uma coment\u00e1rio\"<\/strong><\/span>\r\n<span style=\"color: #ff6600;\"><strong>$ git push<\/strong><\/span><\/pre>\n<h3>Upload Selecionado (extra)<\/h3>\n<p>Caso queira somente enviar somente um tipo de arquivo:<\/p>\n<pre><span style=\"color: #99cc00;\"><strong>$ git add *.html\r\n<\/strong><\/span><strong>$ ... <span style=\"color: #993366;\">commit<\/span> and <span style=\"color: #ff6600;\">push<\/span><\/strong><\/pre>\n<p>Ou somente um arquivo:<\/p>\n<pre><span style=\"color: #99cc00;\"><strong>$ git add filename.html\r\n<\/strong><\/span><strong>$ ... <span style=\"color: #993366;\">commit<\/span> and <span style=\"color: #ff6600;\">push<\/span><\/strong><\/pre>\n<h3>Receber Atuaiza\u00e7\u00f5es<\/h3>\n<p>Antes de come\u00e7ar alterar um projeto em conjunto com outros colaboradores execute esta fun\u00e7\u00e3o:<\/p>\n<pre><strong>$ git pull<\/strong><\/pre>\n<p>Seu projeto estar\u00e1 atualizado.<\/p>\n<h3>Extra<\/h3>\n<p>Deletar um arquivo antes de enviar o pacote:<\/p>\n<pre><strong>$ git rm filename.html<\/strong><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Instala\u00e7\u00e3o Git and GitHub &#8211; Download Comandos B\u00e1sicos $ git clone URL (apenas para baixar o projeto) $ git pull (sempre atualizar o projeto, constantemente) $ git add . (para enviar os aquivos) $ git commit -m &#8220;message&#8221; $ git push Escolher um local para os reposit\u00f3rios Git Crie uma pasta em Documentos chamado &#8220;git&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":527,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","has-thumbnail"],"_links":{"self":[{"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/posts\/505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/comments?post=505"}],"version-history":[{"count":8,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":621,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/posts\/505\/revisions\/621"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/media\/527"}],"wp:attachment":[{"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gnial.com.br\/gnialhelp\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}