diff --git a/book/07-git-tools/sections/bundling.asc b/book/07-git-tools/sections/bundling.asc index 1f2b3566..3a5d98d8 100644 --- a/book/07-git-tools/sections/bundling.asc +++ b/book/07-git-tools/sections/bundling.asc @@ -1,13 +1,13 @@ [[_bundling]] -=== Bundling +=== Agrupaciones -Though we've covered the common ways to transfer Git data over a network (HTTP, SSH, etc), there is actually one more way to do so that is not commonly used but can actually be quite useful. +Aunque ya hemos considerado las maneras mas comunes de transferir la base de datos del Git en el internet (HTTP, SSH, etc.), existe aún una manera de hacerlo, aunque no es muy comúnmente usada puede ser muy útil. -Git is capable of ``bundling'' it's data into a single file. This can be useful in various scenarios. Maybe your network is down and you want to send changes to your co-workers. Perhaps you're working somewhere offsite and don't have access to the local network for security reasons. Maybe your wireless/ethernet card just broke. Maybe you don't have access to a shared server for the moment, you want to email someone updates and you don't want to transfer 40 commits via `format-patch`. +El Git es capaz de ``agrupar'' la base de datos en un único archivo. Esto puede ser muy útil en varios escenarios. Tal vez tu red está caída y quieres enviar cambios a tu co-trabajdores. Quizas estás trabajando en algún lugar sin conexión y no tienes acceso a la red local por motivos de seguridad. Tal vez su tarjeta inalámbrica / ethernet se rompió. Tal vez no tienes acceso al servidor compartido por el momento, y quieres enviar un correo con actualizaciones y no quieres transferir 40 confirmaciones via `format-patch`. -This is where the `git bundle` command can be helpful. The `bundle` command will package up everything that would normally be pushed over the wire with a `git push` command into a binary file that you can email to someone or put on a flash drive, then unbundle into another repository. +Aquí es donde el comando de `git bundle` es muy útil. El comando `bundle` juntará todo lo que normalmente se empujaría sobre el cable con un comando de` push git ‘en un archivo binario que puedes enviar por correo a alguien o poner un flash drive, luego desglosarlo en otro repositorio. -Let's see a simple example. Let's say you have a repository with two commits: +Veamos un ejemplo simple. Digamos que tienes un repositorio con dos confirmaciones: [source,console] ---- @@ -16,16 +16,16 @@ commit 9a466c572fe88b195efd356c3f2bbeccdb504102 Author: Scott Chacon Date: Wed Mar 10 07:34:10 2010 -0800 - second commit + Segunda Confirmacion commit b1ec3248f39900d2a406049d762aa68e9641be25 Author: Scott Chacon Date: Wed Mar 10 07:34:01 2010 -0800 - first commit + Primera confirmaciión ---- -If you want to send that repository to someone and you don't have access to a repository to push to, or simply don't want to set one up, you can bundle it with `git bundle create`. +Si quieres enviar ese repositorio a alguien y no tienes acceso a algún repositorio para hacerlo, o simplemente no quieres configurar uno, puedes juntarlo con el `git bundle create `. [source,console] ---- @@ -37,11 +37,11 @@ Writing objects: 100% (6/6), 441 bytes, done. Total 6 (delta 0), reused 0 (delta 0) ---- -Now you have a file named `repo.bundle` that has all the data needed to re-create the repository's `master` branch. With the `bundle` command you need to list out every reference or specific range of commits that you want to be included. If you intend for this to be cloned somewhere else, you should add HEAD as a reference as well as we've done here. +Ahora tienes un archive nombrado `repo.bundle` este tiene todos los datos nuevos necesarios para re-crear el repositorio de la rama `maester`. Con el comando de `bundle` necesitaras enlistar cualquier referencia o rango especifico de confirmaciones que quieres que sean incluidas. Si tiene la intención de clonar esto en otro lugar, debe agregar HEAD como referencia, así como lo hemos hecho aquí. -You can email this `repo.bundle` file to someone else, or put it on a USB drive and walk it over. +Puedes enviar por correo este archivo `repo.bundle` a alguien más, o ponerlo en una memoria USB y simplemente irte. -On the other side, say you are sent this `repo.bundle` file and want to work on the project. You can clone from the binary file into a directory, much like you would from a URL. +Por otro lado, supongamos que se envía este archivo de `repo.bundle` y deseas trabajar en el proyecto. Puedes clonarlo desde el archivo binario en un directorio, como lo harías desde una URL. [source,console] ---- @@ -53,9 +53,9 @@ $ git log --oneline b1ec324 first commit ---- -If you don't include HEAD in the references, you have to also specify `-b master` or whatever branch is included because otherwise it won't know what branch to check out. +Si no quieres incluir HEAD en las referencias, tambien tendrás que especificar `-b master` o cualquier rama que sea incluída porque de otra manera no sabrá que rama revisar. -Now let's say you do three commits on it and want to send the new commits back via a bundle on a USB stick or email. +Digamos que ahora haces tres confirmaciones en ello y quieres enviar nuevas confirmaciones via agrupacion en una USB o por correo. [source,console] ---- @@ -67,9 +67,9 @@ c99cf5b fourth commit - second repo b1ec324 first commit ---- -First we need to determine the range of commits we want to include in the bundle. Unlike the network protocols which figure out the minimum set of data to transfer over the network for us, we'll have to figure this out manually. Now, you could just do the same thing and bundle the entire repository, which will work, but it's better to just bundle up the difference - just the three commits we just made locally. +Primero necesitamos determinar el rango de confirmaciones que queremos incluir en la agrupación. No como los protocolos de la red que figuraran en el mínimo de datos para transferir desde la red por nosotros, tendremos que hacer esto manualmente. Ahora simplemente puedes hacer la misma cosa y agrupar el repositorio entero, el que trabajará, pero es mejor solo agrupar las diferencias – solamente las tres confirmaciones que hicimos localmente. -In order to do that, you'll have to calculate the difference. As we described in <<_commit_ranges>>, you can specify a range of commits in a number of ways. To get the three commits that we have in our master branch that weren't in the branch we originally cloned, we can use something like `origin/master..master` or `master ^origin/master`. You can test that with the `log` command. +Para hacer eso, tienes que calcular la diferencia. Como hemos descrito en <<_commit_ranges>>, Puedes especificar el rango de confirmaciones en un numero de caminos. Para obtener las tres confirmaciones que tenemos en nuestra rama maestra que no estaban en la rama que copiamos originalmente, podemos usar algo como `origin/master..master` o `master ^origin/master`. Puedes probar esto con el comando de `log`. [source,console] ---- @@ -79,7 +79,7 @@ c99cf5b fourth commit - second repo 7011d3d third commit - second repo ---- -So now that we have the list of commits we want to include in the bundle, let's bundle them up. We do that with the `git bundle create` command, giving it a filename we want our bundle to be and the range of commits we want to go into it. +Entonces ahora que tenemos la lista de confirmaciones queremos incluirlas en la agrupación, agrupémoslas todas. hacemos eso con el comando de `git bundle create`, dandole un nombre al archivo que queremos que sea parte de la agrupación y el rango de confirmaciones que queremos incluir en el mismo. [source,console] ---- @@ -91,9 +91,9 @@ Writing objects: 100% (9/9), 775 bytes, done. Total 9 (delta 0), reused 0 (delta 0) ---- -Now we have a `commits.bundle` file in our directory. If we take that and send it to our partner, she can then import it into the original repository, even if more work has been done there in the meantime. +Ahora tenemos un archivo de `commits.bundle` en nuestro directorio. Si tomamos este y se lo enviamos a nuestro compañero, ella pueda importarlo en el repositorio original, incluso si se ha incluido más trabajo en el tiempo que ha pasado. -When she gets the bundle, she can inspect it to see what it contains before she imports it into her repository. The first command is the `bundle verify` command that will make sure the file is actually a valid Git bundle and that you have all the necessary ancestors to reconstitute it properly. +Cuando obtenga la agrupación, puede inspeccionarlo para ver que contiene antes de que lo importe en el repositorio. El primer comando es el `bundle verify` que hará saber si el archivo es actualmente una agrupacion válida del Git y asi tendras todos los requerimientos necesarios para reconstituiirlo apropiadamente. [source,console] ---- @@ -105,7 +105,7 @@ The bundle requires these 1 ref ../commits.bundle is okay ---- -If the bundler had created a bundle of just the last two commits they had done, rather than all three, the original repository would not be able to import it, since it is missing requisite history. The `verify` command would have looked like this instead: +Si el agrupador a creado una agrupación de solo las dos últimas confirmaciones que se han hecho, en lugar de las tres, tel repositorio original no será capaz de improtarlo, dado que falta un requisito en la historia. El comando de `verify` debería de verse entonces así: [source,console] ---- @@ -114,7 +114,7 @@ error: Repository lacks these prerequisite commits: error: 7011d3d8fc200abe0ad561c011c3852a4b7bbe95 third commit - second repo ---- -However, our first bundle is valid, so we can fetch in commits from it. If you want to see what branches are in the bundle that can be imported, there is also a command to just list the heads: +Como sea, nuestra primera agrupación es válida, Entonces podemos obtener confirmaciones de ella. si quieres ver que ramas están en la agrupación que pueden ser importadas, de igual manera hay un comando para verlo: [source,console] ---- @@ -122,7 +122,7 @@ $ git bundle list-heads ../commits.bundle 71b84daaf49abed142a373b6e5c59a22dc6560dc refs/heads/master ---- -The `verify` sub-command will tell you the heads as well. The point is to see what can be pulled in, so you can use the `fetch` or `pull` commands to import commits from this bundle. Here we'll fetch the 'master' branch of the bundle to a branch named 'other-master' in our repository: +el sub-comando de `verify` te dira el encabezado tambien. el punto es ver que puede ser puesto, para que puedas usar el comando de fetch `fetch` o `pull` para importar confirmaciones de este archivo. Aquí vamos a buscar la rama 'master' de la agrupación por una llamada 'other-master' en nuestro repositorio: [source,console] ---- @@ -131,7 +131,7 @@ From ../commits.bundle * [new branch] master -> other-master ---- -Now we can see that we have the imported commits on the 'other-master' branch as well as any commits we've done in the meantime in our own 'master' branch. +Ahora podemos ver que hemos importado las confirmaciones a la rama de 'other-master'asi mismo como tantas confirmaciones hayamos hecho mientras tanto en nuestra rama 'master' . [source,console] ---- @@ -145,4 +145,4 @@ $ git log --oneline --decorate --graph --all * b1ec324 first commit ---- -So, `git bundle` can be really useful for sharing or doing network-type operations when you don't have the proper network or shared repository to do so. +Entonces, `git bundle` puede ser muy util para compartir o hacer operaciones tipo red cuando no tienes la red adecuada o repositorio compartido para hacerlo.