{"title":"Trabalhando com Git e GitHub","version":"5.0","locale":"pt-br","docname":"internals/contributing/writing-code/working-with-git","url":"/pt-br/5.0/internals/contributing/writing-code/working-with-git/","canonical":"https://djangodocs.dev/pt-br/5.0/internals/contributing/writing-code/working-with-git/","summary":"This section explains how the community can contribute code to Django via pull requests. If you’re interested in how mergers handle them, see Enviando código .…","html":"<h1>Trabalhando com Git e GitHub<a class=\"heading-anchor\" href=\"#working-with-git-and-github\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>This section explains how the community can contribute code to Django via pull\nrequests. If you’re interested in how <a class=\"reference internal\" href=\"/pt-br/5.0/internals/organization/#mergers-team\"><span class=\"std std-ref\">mergers</span></a> handle\nthem, see <a class=\"reference internal\" href=\"/pt-br/5.0/internals/contributing/committing-code/\"><span class=\"doc\">Enviando código</span></a>.</p>\n<p>Abaixo, iremos mostrar como criar um “pull request” no GitHub, contendo as mudanças para o ticket #xxxxx do Trac. Criando um “pull request” totalmente pronto, você tornará mais fácil o trabalho dos revisores, o que quer dizer que seu trabalho está mais próximo de ser “mergeado” no Django.</p>\n<p>Você também poderia fazer upload de um patch tradicional no Trac, mas isso é menos prático para os revisores.</p>\n<section id=\"installing-git\">\n<h2>Instalando Git<a class=\"heading-anchor\" href=\"#installing-git\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django uses <a class=\"reference external\" href=\"https://git-scm.com/\">Git</a> for its source control. You can <a class=\"reference external\" href=\"https://git-scm.com/download\">download</a> Git, but it’s often easier to install with\nyour operating system’s package manager.</p>\n<p>O repositório do Django é hospedado no <a class=\"reference external\" href=\"https://github.com/\">GitHub</a>, e é recomendado que você também trabalhe usando o GitHub.</p>\n<p>After installing Git, the first thing you should do is set up your name and\nemail:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>git<span class=\"w\"> </span>config<span class=\"w\"> </span>--global<span class=\"w\"> </span>user.name<span class=\"w\"> </span><span class=\"s2\">&quot;Your Real Name&quot;</span>\n$<span class=\"w\"> </span>git<span class=\"w\"> </span>config<span class=\"w\"> </span>--global<span class=\"w\"> </span>user.email<span class=\"w\"> </span><span class=\"s2\">&quot;you@email.com&quot;</span>\n</code></pre></div>\n<p>Note que <code class=\"docutils literal notranslate\"><span class=\"pre\">user.name</span></code> deve ser o seu nome real, e não o seu nick no GitHub. O GitHub deve saber o email que você usa pelo campo <code class=\"docutils literal notranslate\"><span class=\"pre\">user.email</span></code>, já que ele será usado para associar os seus commits com a sua conta no GitHub.</p>\n</section>\n<section id=\"setting-up-local-repository\">\n<h2>Configurando o repositório local<a class=\"heading-anchor\" href=\"#setting-up-local-repository\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When you have created your GitHub account, with the nick “GitHub_nick”, and\n<a class=\"reference external\" href=\"https://github.com/django/django/fork\">forked Django’s repository</a>,\ncreate a local copy of your fork:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>clone<span class=\"w\"> </span>https://github.com/GitHub_nick/django.git\n</code></pre></div>\n<p>This will create a new directory “django”, containing a clone of your GitHub\nrepository. The rest of the git commands on this page need to be run within the\ncloned directory, so switch to it now:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"nb\">cd</span><span class=\"w\"> </span>django\n</code></pre></div>\n<p>O seu repositório GitHub será chamado de “origin” no Git.</p>\n<p>You should also set up <code class=\"docutils literal notranslate\"><span class=\"pre\">django/django</span></code> as an “upstream” remote (that is, tell\ngit that the reference Django repository was the source of your fork of it):</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>remote<span class=\"w\"> </span>add<span class=\"w\"> </span>upstream<span class=\"w\"> </span>https://github.com/django/django.git\ngit<span class=\"w\"> </span>fetch<span class=\"w\"> </span>upstream\n</code></pre></div>\n<p>You can add other remotes similarly, for example:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>remote<span class=\"w\"> </span>add<span class=\"w\"> </span>akaariai<span class=\"w\"> </span>https://github.com/akaariai/django.git\n</code></pre></div>\n</section>\n<section id=\"working-on-a-ticket\">\n<h2>Trabalhando em um ticket<a class=\"heading-anchor\" href=\"#working-on-a-ticket\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When working on a ticket, create a new branch for the work, and base that work\non <code class=\"docutils literal notranslate\"><span class=\"pre\">upstream/main</span></code>:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>checkout<span class=\"w\"> </span>-b<span class=\"w\"> </span>ticket_xxxxx<span class=\"w\"> </span>upstream/main\n</code></pre></div>\n<p>A flag -b cria uma nova branch para você localmente. Não hesite em criar novas branches mesmo para as coisas mais simples - esse é o motivo delas existirem.</p>\n<p>If instead you were working for a fix on the 1.4 branch, you would do:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>checkout<span class=\"w\"> </span>-b<span class=\"w\"> </span>ticket_xxxxx_1_4<span class=\"w\"> </span>upstream/stable/1.4.x\n</code></pre></div>\n<p>Assume the work is carried on the ticket_xxxxx branch. Make some changes and\ncommit them:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>commit\n</code></pre></div>\n<p>When writing the commit message, follow the <a class=\"reference internal\" href=\"/pt-br/5.0/internals/contributing/committing-code/#committing-guidelines\"><span class=\"std std-ref\">commit message\nguidelines</span></a> to ease the work of the merger. If you’re\nuncomfortable with English, try at least to describe precisely what the commit\ndoes.</p>\n<p>If you need to do additional work on your branch, commit as often as\nnecessary:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>commit<span class=\"w\"> </span>-m<span class=\"w\"> </span><span class=\"s1\">&#39;Added two more tests for edge cases&#39;</span>\n</code></pre></div>\n<section id=\"publishing-work\">\n<h3>Publicando trabalho<a class=\"heading-anchor\" href=\"#publishing-work\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>You can publish your work on GitHub by running:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>push<span class=\"w\"> </span>origin<span class=\"w\"> </span>ticket_xxxxx\n</code></pre></div>\n<p>Quando acessar sua página no GitHub, irá perceber que um novo “branch” foi criado.</p>\n<p>Se você está trabalhando em um ticket do Trac, você deve mencionar no ticket que o seu trabalho está disponível através da branch ticket_xxxxx do seu repositório no GitHub. Inclua um link para a sua branch.</p>\n<p>Tenha em mente que a branch acima é chamada de “topic branch” no linguajar do Git. Você é livre para reescrever o histórico dessa branch, através do uso do <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">rebase</span></code> por exemplo. Outras pessoas não deveriam basear o seu trabalho em uma branch como essa, porque os clones dela serão corrompidos quando você editar os seus commits.</p>\n<p>There are also “public branches”. These are branches other people are supposed\nto fork, so the history of these branches should never change. Good examples\nof public branches are the <code class=\"docutils literal notranslate\"><span class=\"pre\">main</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">stable/A.B.x</span></code> branches in the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django/django</span></code> repository.</p>\n<p>Quando você achar que o seu trabalho está pronto para ser enviado para o Django, você deve criar um pull request no GitHub. Um bom pull request significa:</p>\n<ul class=\"simple\">\n<li><p>Commits com uma mudança lógica, seguindo o <a class=\"reference internal\" href=\"/pt-br/5.0/internals/contributing/writing-code/coding-style/\"><span class=\"doc\">estilo de código</span></a>,</p></li>\n<li><p>Mensagens bem formatadas para cada commit: uma linha de sumário e então parágrafos embutidos em até 72 caracteres depois dela – veja as <a class=\"reference internal\" href=\"/pt-br/5.0/internals/contributing/committing-code/#committing-guidelines\"><span class=\"std std-ref\">regras de commit</span></a> para mais detalhes.</p></li>\n<li><p>Documentação e testes, quando necessário – na verdade testes são sempre necessários, exceto para mudanças na documentação.</p></li>\n</ul>\n<p>A suíte de testes deve passar e a documentação deve ser gerada sem quaisquer warnings.</p>\n<p>Uma vez que tenha criado seu pull request, você deve adicionar um comentário no ticket do Trac relacionado explicando o que você fez. Em particular, você deve mencionar o ambiente no qual você rodou os testes, por exemplo: “all tests pass under SQLite and MySQL”.</p>\n<p>Pull requests at GitHub have only two states: open and closed. The merger who\nwill deal with your pull request has only two options: merge it or close it.\nFor this reason, it isn’t useful to make a pull request until the code is ready\nfor merging – or sufficiently close that a merger will finish it themselves.</p>\n</section>\n<section id=\"rebasing-branches\">\n<h3>Fazendo rebase de branches<a class=\"heading-anchor\" href=\"#rebasing-branches\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>No exemplo acima, você criou dois commits, o “Fixed ticket_xxxxx” e o “Added two more tests”.</p>\n<p>Nós não queremos ter o histórico inteiro do seu processo de trabalho no seu repositório. O seu commit “Added two more tests” seria poluído e pouco amigável. Ao invés disso, nós preferimos ter apenas um commit contendo todo o seu trabalho.</p>\n<p>To rework the history of your branch you can squash the commits into one by\nusing interactive rebase:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>rebase<span class=\"w\"> </span>-i<span class=\"w\"> </span>HEAD~2\n</code></pre></div>\n<p>O HEAD~2 acima é um atalho para os dois últimos commits. O comando acima irá abrir um editor mostrando os dois commits, prefixados com a palavra “pick”.</p>\n<p>Mude “pick” na segunda linha para “squash”. Isso manterá o primeiro commit, e esmagará o segundo commit dentro do primeiro. Salve e feche o editor. Uma segunda janela do editor deverá abrir, de modo que você possa reescrever a mensagem de commit agora que ele está incluindo os seus dois passos.</p>\n<p>You can also use the “edit” option in rebase. This way you can change a single\ncommit, for example to fix a typo in a docstring:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>rebase<span class=\"w\"> </span>-i<span class=\"w\"> </span>HEAD~3\n<span class=\"c1\"># Choose edit, pick, pick for the commits</span>\n<span class=\"c1\"># Now you are able to rework the commit (use git add normally to add changes)</span>\n<span class=\"c1\"># When finished, commit work with &quot;--amend&quot; and continue</span>\ngit<span class=\"w\"> </span>commit<span class=\"w\"> </span>--amend\n<span class=\"c1\"># Reword the commit message if needed</span>\ngit<span class=\"w\"> </span>rebase<span class=\"w\"> </span>--continue\n<span class=\"c1\"># The second and third commits should be applied.</span>\n</code></pre></div>\n<p>If your topic branch is already published at GitHub, for example if you’re\nmaking minor changes to take into account a review, you will need to force-push\nthe changes:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>push<span class=\"w\"> </span>-f<span class=\"w\"> </span>origin<span class=\"w\"> </span>ticket_xxxxx\n</code></pre></div>\n<p>Note that this will rewrite history of ticket_xxxxx - if you check the commit\nhashes before and after the operation at GitHub you will notice that the commit\nhashes do not match anymore. This is acceptable, as the branch is a topic\nbranch, and nobody should be basing their work on it.</p>\n</section>\n<section id=\"after-upstream-has-changed\">\n<h3>Depois que o upstream foi modificado<a class=\"heading-anchor\" href=\"#after-upstream-has-changed\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>When upstream (<code class=\"docutils literal notranslate\"><span class=\"pre\">django/django</span></code>) has changed, you should rebase your work. To\ndo this, use:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>fetch<span class=\"w\"> </span>upstream\ngit<span class=\"w\"> </span>rebase<span class=\"w\"> </span>upstream/main\n</code></pre></div>\n<p>The work is automatically rebased using the branch you forked on, in the\nexample case using <code class=\"docutils literal notranslate\"><span class=\"pre\">upstream/main</span></code>.</p>\n<p>O comando rebase remove todos os seus commits locais temporariamente, aplica os commits do upstream, e então aplica os seus commits locais novamente.</p>\n<p>Se houver conflitos nos “merges”, precisamos resolvê-los e então usar o <code class=\"docutils literal notranslate\"><span class=\"pre\">get</span> <span class=\"pre\">rebase</span> <span class=\"pre\">--continue</span></code>. Em qualquer momento você pode usar o <code class=\"docutils literal notranslate\"><span class=\"pre\">get</span> <span class=\"pre\">rebase</span> <span class=\"pre\">--abort</span></code> para retornar ao estado original.</p>\n<p>Note que você quer fazer <em>rebase</em> no upstream, e não <em>merge</em> do upstream.</p>\n<p>A razão para isso é que ao fazer o rebase, os seus commits sempre ficarão <em>no topo</em> do trabalho realizado no upstream e não <em>misturado com</em> as mudanças do upstream. Desta forma a sua topic branch irá conter somente commits relacionados a ela, o que faz com que o  processo de esmagar os seus commits fique mais simples.</p>\n</section>\n<section id=\"after-review\">\n<h3>Depois de revisar<a class=\"heading-anchor\" href=\"#after-review\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>É muito incomum receber qualquer porção de código não trivial incluída no core do Django sem quaisquer alterações sendo solicitadas pelos revisores. Neste caso, costuma ser uma boa ideia adicionar as mudanças na forma de um commit incremental para o seu trabalho. Isso permite que os revisores possam checar facilmente quais mudanças você fez.</p>\n<p>In this case, do the changes required by the reviewer. Commit as often as\nnecessary. Before publishing the changes, rebase your work. If you added two\ncommits, you would run:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>rebase<span class=\"w\"> </span>-i<span class=\"w\"> </span>HEAD~2\n</code></pre></div>\n<p>Squash the second commit into the first. Write a commit message along the lines\nof:</p>\n<div class=\"code-block\" data-language=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Text code\"><code>Made changes asked in review by &lt;reviewer&gt;\n\n- Fixed whitespace errors in foobar\n- Reworded the docstring of bar()\n</code></pre></div>\n<p>Finally, push your work back to your GitHub repository. Since you didn’t touch\nthe public commits during the rebase, you should not need to force-push:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>push<span class=\"w\"> </span>origin<span class=\"w\"> </span>ticket_xxxxx\n</code></pre></div>\n<p>O seu pull request deve agora conter um novo commit também.</p>\n<p>Note that the merger is likely to squash the review commit into the previous\ncommit when committing the code.</p>\n</section>\n</section>\n<section id=\"working-on-a-patch\">\n<h2>Trabalhando em um patch<a class=\"heading-anchor\" href=\"#working-on-a-patch\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>One of the ways that developers can contribute to Django is by reviewing\npatches. Those patches will typically exist as pull requests on GitHub and\ncan be easily integrated into your local repository:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>git<span class=\"w\"> </span>checkout<span class=\"w\"> </span>-b<span class=\"w\"> </span>pull_xxxxx<span class=\"w\"> </span>upstream/main\ncurl<span class=\"w\"> </span>-L<span class=\"w\"> </span>https://github.com/django/django/pull/xxxxx.patch<span class=\"w\"> </span><span class=\"p\">|</span><span class=\"w\"> </span>git<span class=\"w\"> </span>am\n</code></pre></div>\n<p>Isso irá criar uma nova branch e então aplicar as mudanças do pull request nela. Neste momento você pode rodar os testes ou fazer qualquer coisa que você precise para investigar a qualidade do patch.</p>\n<p>For more detail on working with pull requests see the\n<a class=\"reference internal\" href=\"/pt-br/5.0/internals/contributing/committing-code/#handling-pull-requests\"><span class=\"std std-ref\">guidelines for mergers</span></a>.</p>\n</section>\n<section id=\"summary\">\n<h2>Sumário<a class=\"heading-anchor\" href=\"#summary\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<ul class=\"simple\">\n<li><p>Trabalhe no GitHub se você puder.</p></li>\n<li><p>Anuncie o seu trabalho no ticket do Trac adicionando um link para a sua branch no GitHub.</p></li>\n<li><p>Quando você tiver algo pronto, faça um pull request.</p></li>\n<li><p>Faça os pull requests tão bons quanto puder.</p></li>\n<li><p>Quando estiver fazendo correçṍes no seu trabalho, use <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">rebase</span> <span class=\"pre\">-i</span></code> para esmagar os commits.</p></li>\n<li><p>Quando o upstream tiver sido alterado, faça <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">fetch</span> <span class=\"pre\">upstream;</span> <span class=\"pre\">git</span> <span class=\"pre\">rebase</span></code>.</p></li>\n</ul>\n</section>","rootId":"working-with-git-and-github","toc":[{"title":"Instalando Git","anchor":"installing-git","children":[]},{"title":"Configurando o repositório local","anchor":"setting-up-local-repository","children":[]},{"title":"Trabalhando em um ticket","anchor":"working-on-a-ticket","children":[{"title":"Publicando trabalho","anchor":"publishing-work","children":[]},{"title":"Fazendo rebase de branches","anchor":"rebasing-branches","children":[]},{"title":"Depois que o upstream foi modificado","anchor":"after-upstream-has-changed","children":[]},{"title":"Depois de revisar","anchor":"after-review","children":[]}]},{"title":"Trabalhando em um patch","anchor":"working-on-a-patch","children":[]},{"title":"Sumário","anchor":"summary","children":[]}],"breadcrumbs":[{"docname":"internals/index","title":"Funcionamento interno do Projeto Django","url":"/pt-br/5.0/internals/"},{"docname":"internals/contributing/index","title":"Contribuindo com o Django","url":"/pt-br/5.0/internals/contributing/"},{"docname":"internals/contributing/writing-code/index","title":"Escrevendo código","url":"/pt-br/5.0/internals/contributing/writing-code/"}],"prev":{"docname":"internals/contributing/writing-code/submitting-patches","title":"Enviando patches","url":"/pt-br/5.0/internals/contributing/writing-code/submitting-patches/"},"next":{"docname":"internals/contributing/writing-code/javascript","title":"JavaScript","url":"/pt-br/5.0/internals/contributing/writing-code/javascript/"},"formats":{"html":"/pt-br/5.0/internals/contributing/writing-code/working-with-git/","markdown":"/pt-br/5.0/internals/contributing/writing-code/working-with-git.md","json":"/pt-br/5.0/internals/contributing/writing-code/working-with-git.json"},"source":"https://github.com/django/django/blob/stable/5.0.x/docs/internals/contributing/writing-code/working-with-git.txt","official":"https://docs.djangoproject.com/pt-br/5.0/internals/contributing/writing-code/working-with-git/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}