From cb740cf5633f21ca5ceb0d8a98f10d5f1274e6fc Mon Sep 17 00:00:00 2001 From: Samuel Castillo Date: Fri, 16 Feb 2018 15:08:08 -0400 Subject: [PATCH] =?UTF-8?q?subtre-merges.asc=20Traducida=20a=20Espa=C3=B1o?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Palabras como commit, branch, master y tarball no fueron traducidas para no distorsionar mucho el contexto. Se tradujo subtree merge como: convergencia de subárbol. Las sugerencias son bienvenidas. 552 translatable words have been translated to spanish on this PR. --- book/07-git-tools/sections/subtree-merges.asc | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/book/07-git-tools/sections/subtree-merges.asc b/book/07-git-tools/sections/subtree-merges.asc index 51b8e2ef..abc3d66b 100644 --- a/book/07-git-tools/sections/subtree-merges.asc +++ b/book/07-git-tools/sections/subtree-merges.asc @@ -1,13 +1,13 @@ [[_subtree_merge]] -===== Subtree Merging +===== Convergencia de Subárbol -The idea of the subtree merge is that you have two projects, and one of the projects maps to a subdirectory of the other one and vice versa. -When you specify a subtree merge, Git is often smart enough to figure out that one is a subtree of the other and merge appropriately. +La idea de la convergencia de subárboles es que usted tiene dos proyectos, de los cuales uno lleva un subdirectorio del otro y viceversa +Cuando especifica una convergencia de subárbol, Git suele ser lo suficientemente inteligente para comprender que uno es un subárbol del otro y convergerá apropiadamente. -We'll go through an example of adding a separate project into an existing project and then merging the code of the second into a subdirectory of the first. +Veremos un ejemplo donde se añade un proyecto separado a un proyecto existente y luego se converge el código del segundo dentro de un subdirectorio del primero. -First, we'll add the Rack application to our project. -We'll add the Rack project as a remote reference in our own project and then check it out into its own branch: +Primero, añadiremos la aplicación Rack a nuestro proyecto. +Añadiremos el proyecto Rack como referencia remota en nuestro propio proyecto y luego lo colocaremos en su propio branch: [source,console] ---- @@ -29,8 +29,8 @@ Branch rack_branch set up to track remote branch refs/remotes/rack_remote/master Switched to a new branch "rack_branch" ---- -Now we have the root of the Rack project in our `rack_branch` branch and our own project in the `master` branch. -If you check out one and then the other, you can see that they have different project roots: +Ahora tenemos la raíz del proyecto Rack en nuestro branch `rack_branch` y nuestro proyecto en el branch `master`. +Si verifica uno y luego el otro, puede observar que tienen diferentes raíces de proyecto: [source,console] ---- @@ -43,21 +43,21 @@ $ ls README ---- -This is sort of a strange concept. Not all the branches in your repository actually have to be branches of the same project. It's not common, because it's rarely helpful, but it's fairly easy to have branches contain completely different histories. +Este concepto es algo extraño. No todos los branchs en su repositorio tendrán que ser branchs del mismo proyecto como tal. No es común, porque rara vez es de ayuda, pero es fácil que los branchs contengan historias completamente diferentes. -In this case, we want to pull the Rack project into our `master` project as a subdirectory. -We can do that in Git with `git read-tree`. -You’ll learn more about `read-tree` and its friends in <<_git_internals>>, but for now know that it reads the root tree of one branch into your current staging area and working directory. -We just switched back to your `master` branch, and we pull the `rack_branch` branch into the `rack` subdirectory of our `master` branch of our main project: +En este caso, queremos integrar el proyecto Rack a nuestro proyecto `master` como un subdirectorio. +Podemos hacer eso en Git con `git read-tree`. +Aprenderá más sobre `read-tree` y sus amigos en <<_git_internals>>, pero por ahora sepa que este interpreta el árbol raíz de un branch en su area de staging y directorio de trabajo. +Sólo cambiamos de vuelta a su branch `master`, e integramos el branch `rack_branch` al subdirectorio `rack` de nuestro branch `master` de nuestro proyecto principal: [source,console] ---- $ git read-tree --prefix=rack/ -u rack_branch ---- -When we commit, it looks like we have all the Rack files under that subdirectory – as though we copied them in from a tarball. -What gets interesting is that we can fairly easily merge changes from one of the branches to the other. -So, if the Rack project updates, we can pull in upstream changes by switching to that branch and pulling: +Cuando hacemos commit, parece que tenemos todos los archivos Rack bajo ese subdirectorio - como si los hubiéramos copiado de un tarball. +Lo interesante es que podemos facilmente converger cambios de uno de los branchs al otro. +Entonces, si el proyecto Rack se actualiza, podemos atraer cambios río arriba alternando a esa branch e incorporando: [source,console] ---- @@ -65,8 +65,8 @@ $ git checkout rack_branch $ git pull ---- -Then, we can merge those changes back into our `master` branch. -To pull in the changes and prepopulate the commit message, use the `--squash` and `--no-commit` options, as well as the recursive merge strategy's `-Xsubtree` option. (The recursive strategy is the default here, but we include it for clarity.) +Luego, podemos converger de vuelta esos cambios a nuestro branch `master`. +Para incorporar los cambios y rellenar previamente el mensaje de commit, utilice las opciones `--squash` y `--no-commit`, así como la estrategia de convergencia recursiva de la opción `-Xsubtree`. (La estrategia recursiva está aquí por defecto, pero la incluímos para aclarar.) [source,console] ---- @@ -76,20 +76,20 @@ Squash commit -- not updating HEAD Automatic merge went well; stopped before committing as requested ---- -All the changes from the Rack project are merged in and ready to be committed locally. -You can also do the opposite – make changes in the `rack` subdirectory of your master branch and then merge them into your `rack_branch` branch later to submit them to the maintainers or push them upstream. +Todos los cambios del proyeto Rack se convergieron y están listos para ser encomendados localmente. +También puede hacer lo opuesto - hacer cambios en el subdirectorio `rack` de su master branch y luego convergerlos a su branch `rack_branch` más adelante para entregarlos a los mantenedores o empujarlos río arriba. -This gives us a way to have a workflow somewhat similar to the submodule workflow without using submodules (which we will cover in <<_git_submodules>>). We can keep branches with other related projects in our repository and subtree merge them into our project occasionally. It is nice in some ways, for example all the code is committed to a single place. However, it has other drawbacks in that it's a bit more complex and easier to make mistakes in reintegrating changes or accidentally pushing a branch into an unrelated repository. +Esto nos deja una manera de tener un flujo de trabajo algo similar al flujo de trabajo de submódulo sin utilizar submódulos (de los cuales hablaremos en <<_git_submodules>>). Podemos mantener branchs con otros proyectos relacionados en nuestro repositorio y convergerlos tipo subárbol a nuestro proyecto ocasionalmente. Esto es bueno por ciertas razones, por ejemplo todo el códido se encomienda a un único lugar. Sin embargo, tiene el defecto de ser un poco más complejo y facilita el cometer errores al reintegrar cambios o empujar accidentalmente un branch a un repositorio con el que no guarda relación. -Another slightly weird thing is that to get a diff between what you have in your `rack` subdirectory and the code in your `rack_branch` branch – to see if you need to merge them – you can’t use the normal `diff` command. -Instead, you must run `git diff-tree` with the branch you want to compare to: +Otra particularidad es que para diferenciar entre lo que tiene en su subdirectorio `rack` y el código en su branch `rack_branch` - para ver si necesita convergerlos - no puede usar el comando `diff` normal. +En lugar de esto, debe ejecutar `git diff-tree` con el branch que desea comparar a: [source,console] ---- $ git diff-tree -p rack_branch ---- -Or, to compare what is in your `rack` subdirectory with what the `master` branch on the server was the last time you fetched, you can run +O, para comparar lo que hay en su subdirectorio `rack` con lo que era el branch `master` en el servidor la última vez que usted hizo fetch, ejecute [source,console] ----