Blame programming-guidelines/es/version-control.page

Packit 1470ea
Packit 1470ea
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="topic" id="version-control" xml:lang="es">
Packit 1470ea
Packit 1470ea
  <info>
Packit 1470ea
    <link type="guide" xref="index#general-guidelines"/>
Packit 1470ea
Packit 1470ea
    <credit type="author copyright">
Packit 1470ea
      <name>Philip Withnall</name>
Packit 1470ea
      <email its:translate="no">philip.withnall@collabora.co.uk</email>
Packit 1470ea
      <years>2015</years>
Packit 1470ea
    </credit>
Packit 1470ea
Packit 1470ea
    <include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>
Packit 1470ea
Packit 1470ea
    <desc>Control de versiones de código con git</desc>
Packit 1470ea
  
Packit 1470ea
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
Packit 1470ea
      <mal:name>Daniel Mustieles</mal:name>
Packit 1470ea
      <mal:email>daniel.mustieles@gmail.com</mal:email>
Packit 1470ea
      <mal:years>2016</mal:years>
Packit 1470ea
    </mal:credit>
Packit 1470ea
  
Packit 1470ea
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
Packit 1470ea
      <mal:name>Javier Mazorra</mal:name>
Packit 1470ea
      <mal:email>mazi.debian@gmail.com</mal:email>
Packit 1470ea
      <mal:years>2016</mal:years>
Packit 1470ea
    </mal:credit>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
  <title>Control de versiones</title>
Packit 1470ea
Packit 1470ea
  <synopsis>
Packit 1470ea
    <title>Resumen</title>
Packit 1470ea
Packit 1470ea
    

Packit 1470ea
      git is used for version control for all GNOME projects. This page assumes
Packit 1470ea
      good working knowledge of git; some introductory material is available
Packit 1470ea
      <link href="https://www.atlassian.com/git/tutorials/">here</link>, and a
Packit 1470ea
      <link href="https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf">git
Packit 1470ea
      cheatsheet is here</link>.
Packit 1470ea
    

Packit 1470ea
Packit 1470ea
    <list>
Packit 1470ea
      <item>

Haga commits atómicos y reversibles. (<link xref="#guidelines-for-making-commits"/>)

</item>
Packit 1470ea
      <item>

Incluya un razonamiento completo en los mensajes de commit, así como enlaces a los informes de error o a la especificaciones. (Consulte la <link xref="#guidelines-for-making-commits"/>)

</item>
Packit 1470ea
      <item>

Haga los cambios grandes, como los renombrados, en commits separados. (Consulte la <link xref="#guidelines-for-making-commits"/>)

</item>
Packit 1470ea
      <item>

Packit 1470ea
        Merge changes from feature branches by rebasing.
Packit 1470ea
        (<link xref="#use-of-git"/>)
Packit 1470ea
      

</item>
Packit 1470ea
    </list>
Packit 1470ea
  </synopsis>
Packit 1470ea
Packit 1470ea
  <section id="use-of-git">
Packit 1470ea
    <title>Uso de Git</title>
Packit 1470ea
Packit 1470ea
    

La mayoría de los repositorios de GNOME siguen estas reglas:

Packit 1470ea
    <list>
Packit 1470ea
      <item>

Packit 1470ea
        No forced pushes. Except for branches with the wip/ prefix
Packit 1470ea
        (work-in-progress), the commits’ history must not be modified, as
Packit 1470ea
        contributors rely on it.
Packit 1470ea
      

</item>
Packit 1470ea
      <item>

Rebase los commits en lugar de mezclarlos, para tener un histórico lineal (más fácil de seguir).

</item>
Packit 1470ea
      <item>

Packit 1470ea
        Work on feature branches on GNOME git in wip/ branches,
Packit 1470ea
        then rebase on master and fast-forward merge the changes. It is a good
Packit 1470ea
        practice to also add your nickname to the branch name, as
Packit 1470ea
        wip/nickname/feature.
Packit 1470ea
      

</item>
Packit 1470ea
      <item>

Packit 1470ea
        Hide <link href="https://sethrobertson.github.io/GitBestPractices/#sausage">sausage
Packit 1470ea
        making</link> by squashing commits before merging.
Packit 1470ea
      

</item>
Packit 1470ea
    </list>
Packit 1470ea
  </section>
Packit 1470ea
Packit 1470ea
  <section id="guidelines-for-making-commits">
Packit 1470ea
    <title>Guía para realizar commits</title>
Packit 1470ea
Packit 1470ea
    

Packit 1470ea
      Commits should be as small as possible, but no smaller. Each commit should
Packit 1470ea
      address a single issue, containing only changes related to that issue. The
Packit 1470ea
      message for each commit should describe the issue, explain what causes it,
Packit 1470ea
      and explain how it has been fixed if it is not obvious. If the commit is
Packit 1470ea
      associated with a bug report, the full URI for the bug report should be
Packit 1470ea
      put on a line by itself at the bottom of the commit message. Similarly,
Packit 1470ea
      the ID for the git commit (from <cmd>git log --oneline</cmd>) should
Packit 1470ea
      be copied into the bug report once the commit has been pushed, so it is
Packit 1470ea
      easy to find one from the other.
Packit 1470ea
    

Packit 1470ea
Packit 1470ea
    

Packit 1470ea
      The changes in each commit should be easy to read. For example, they
Packit 1470ea
      should not unnecessarily change whitespace or indentation. Large,
Packit 1470ea
      mechanical changes, such as renaming a file or function, should be put in
Packit 1470ea
      separate commits from modifications to code inside that file or function,
Packit 1470ea
      so that the latter changes do not get buried and lost in the former.
Packit 1470ea
    

Packit 1470ea
Packit 1470ea
    

Packit 1470ea
      The following principles give the reasoning for all the advice above:
Packit 1470ea
    

Packit 1470ea
    <list>
Packit 1470ea
      <item>

Packit 1470ea
        Each commit should take the repository from one working state to
Packit 1470ea
        another, otherwise
Packit 1470ea
        <link href="http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git#Binary-Search">bisection</link>
Packit 1470ea
        is impossible.
Packit 1470ea
      

</item>
Packit 1470ea
      <item>

Packit 1470ea
        Each commit should be individually revertable. If it later turns out
Packit 1470ea
        that the commit was a bad idea,
Packit 1470ea
        <cmd>git revert commit ID</cmd> should take the repository
Packit 1470ea
        from a working state to another working state.
Packit 1470ea
      

</item>
Packit 1470ea
      <item>

Packit 1470ea
        The reasoning for each commit, and its relationship to external
Packit 1470ea
        resources like specifications and bug reports, should be clear, to the
Packit 1470ea
        extent that commits written by one developer a year in the past should
Packit 1470ea
        still be understandable by a second developer without having to trace
Packit 1470ea
        through the changes and work out what they do.
Packit 1470ea
      

</item>
Packit 1470ea
      <item>

Packit 1470ea
        Each commit should be written once, and designed to be read many times,
Packit 1470ea
        by many reviewers and future programmers.
Packit 1470ea
      

</item>
Packit 1470ea
    </list>
Packit 1470ea
  </section>
Packit 1470ea
Packit 1470ea
  <section id="merging-procedure">
Packit 1470ea
    <title>Merging Procedure</title>
Packit 1470ea
Packit 1470ea
    

Packit 1470ea
      To merge a feature branch named my-branch into master, use
Packit 1470ea
      the following commands:
Packit 1470ea
    

Packit 1470ea
    
Packit 1470ea
git checkout master
Packit 1470ea
git pull
Packit 1470ea
Packit 1470ea
git checkout wip/my-branch
Packit 1470ea
git rebase --interactive master
Packit 1470ea
# Ensure the rebase is successful; test the changes
Packit 1470ea
Packit 1470ea
git checkout master
Packit 1470ea
git merge wip/my-branch
Packit 1470ea
git push
Packit 1470ea
Packit 1470ea
# wip/my-branch can now be deleted
Packit 1470ea
git push origin :wip/my-branch
Packit 1470ea
git branch -D wip/my-branch
Packit 1470ea
  </section>
Packit 1470ea
Packit 1470ea
  <section id="external-links">
Packit 1470ea
    <title>Enlaces externos</title>
Packit 1470ea
Packit 1470ea
    <list>
Packit 1470ea
      <item>

<link href="https://sethrobertson.github.io/GitBestPractices/">Buenas prácticas de Git</link>

</item>
Packit 1470ea
      <item>

<link href="https://help.github.com/categories/using-git/">P+F de Git</link>

</item>
Packit 1470ea
      <item>

<link href="https://www.atlassian.com/git/tutorials/">Tutorial de Atlassian sobre git</link>

</item>
Packit 1470ea
      <item>

<link href="http://git-scm.com/docs/gittutorial">Tutorial oficial de git</link>

</item>
Packit 1470ea
      <item>

<link href="https://try.github.io/">Tutorial interactivo de git</link>

</item>
Packit 1470ea
      <item>

<link href="http://www.git-tower.com/learn/">Tutorial de git-tower</link>

</item>
Packit 1470ea
    </list>
Packit 1470ea
  </section>
Packit 1470ea
</page>