changes to make the game in spanish

This commit is contained in:
Mikel Aldalur 2024-07-11 10:38:19 +02:00
parent 9da0bd1fbd
commit 7c24e9b68e
101 changed files with 2073 additions and 2074 deletions

View file

@ -1,43 +1,43 @@
title = Yellow brick road título = Camino de ladrillos amarillos
cards = checkout commit-auto reset-hard bisect-start bisect-good bisect-bad tarjetas = pago confirmar-restablecimiento automático-duro bisect-start bisect-bueno bisect-malo
[description] [descripción]
(Please zoom out a bit using your mouse wheel! :D) (¡Aleje un poco el zoom con la rueda del mouse! :D)
Oh no! You have lost your key at some point during the day! ¡Oh, no! ¡Has perdido tu llave en algún momento del día!
Sure, you could look at every single commit in an attempt to find it - but there's a better way: your time machine has a built-in way to find the point in time where things went wrong quickly! Claro, puedes mirar cada confirmación en un intento de encontrarla, pero hay una manera mejor: ¡tu máquina del tiempo tiene una forma incorporada de encontrar el momento en el que las cosas salieron mal rápidamente!
First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key *in your pocket*, and play the "bisect good" card. Primero, juega la carta de "inicio en bisección". Luego, vaya a una confirmación donde no tenga la clave y juegue la carta "bisecta mala". Del mismo modo, vaya a un compromiso desde el principio donde tenga la llave *en su bolsillo* y juegue la carta "bisecta bien".
After you've found the last good commit, reset the main branch to it. What happened to the key after you lost it? Una vez que haya encontrado la última confirmación buena, restablezca la rama principal. ¿Qué pasó con la llave después de que la perdiste?
[setup] [configuración]
echo "You still have your key." > you echo "Aún tienes tu llave". > tu
for i in {1..30}; do para i en {1..30}; hacer
if test $i -eq 12; then si prueba $i -eq 12; entonces
echo "Your pocket is empty." > you echo "Tu bolsillo está vacío." > tu
echo "Is on the ground." > key echo "Está en el suelo". > clave
fi fi
if test $i -eq 13; then si prueba $i -eq 13; entonces
echo "Is holding a key in its beak." > bird echo "Tiene una llave en el pico." > pájaro
rm key llave rm
fi fi
if test $i -eq 14; then si prueba $i -eq 14; entonces
rm bird pájaro rm
fi fi
git add . git agregar.
git commit --allow-empty -m "$i" git commit --allow-empty -m "$i"
done hecho
[win] [ganar]
# Find the last good commit # Encuentra el último compromiso bueno
test "$(git log --pretty=%s main | head -1)" -eq 11 prueba "$(git log --pretty=%s main | head -1)" -eq 11
[congrats] [felicitaciones]
Well done! :) The only problem is that you now have to walk all the way back home, again... ¡Bien hecho! :) El único problema es que ahora tienes que caminar todo el camino de regreso a casa, otra vez...

View file

@ -1 +1 @@
bisect bisecar

View file

@ -1,44 +1,44 @@
title = Creating branches título = Creando ramas
cards = checkout commit-auto branch branch-delete reset-hard tarjetas = pago confirmar-auto rama-eliminar rama restablecer-hard
[description] [descripción]
You were invited to two parties! At one of them, your favorite band is playing - and the other one is your best friend's birthday party. Where should you go? No worries - as a time travel agent in training, you can go to both parties! ¡Te invitaron a dos fiestas! En uno de ellos toca tu grupo favorito y en el otro es la fiesta de cumpleaños de tu mejor amigo. ¿A dónde deberías ir? No te preocupes: como agente de viajes en el tiempo en formación, ¡puedes ir a ambas partes!
To make it easier to tell which timeline is which, you can create time portals! (We call these "branches".) Para que sea más fácil saber qué línea de tiempo es cuál, ¡puedes crear portales de tiempo! (A estas las llamamos "ramas".)
[cli] [cli]
Branches also make it really easy to travel between different places using the command line! As soon as you have a branch called "birthday", you can type `git checkout birthday` to travel to it! ¡Las sucursales también hacen que sea muy fácil viajar entre diferentes lugares usando la línea de comando! ¡Tan pronto como tengas una rama llamada "cumpleaños", puedes escribir `git checkout cumpleaños` para viajar hasta ella!
[setup] [configuración]
echo "You wrap the birthday present, and grab your concert ticket." > you echo "Envuelves el regalo de cumpleaños y tomas tu entrada para el concierto". > tu
git add . git agregar.
git commit -m "Evening preparations" git commit -m "Preparativos de la tarde"
echo "You go to the birthday party!" >> you echo "¡Vas a la fiesta de cumpleaños!" >> tu
git add . git agregar.
git commit -m "Go to the birthday" git commit -m "Ir al cumpleaños"
git checkout HEAD~1 git pago CABEZA~1
echo "You go to the concert!" > you echo "¡Vas al concierto!" > tu
git add . git agregar.
git commit -m "Go to the concert" git commit -m "Ir al concierto"
git checkout HEAD~1 git pago CABEZA~1
git branch -D main rama git -D principal
[win] [ganar]
# Create a branch called 'birthday' that points to the birthday timeline. # Crea una rama llamada 'cumpleaños' que apunta a la línea de tiempo del cumpleaños.
git show birthday | grep 'to the birthday' git mostrar cumpleaños | grep 'al cumpleaños'
# Create a branch called 'concert' that points to the concert timeline. # Crea una rama llamada 'concierto' que apunte a la línea de tiempo del concierto.
git show concert | grep 'to the concert' concierto de espectáculo de git | grep 'al concierto'
[congrats] [felicitaciones]
Now you can travel between those branches easily (using `git checkout`) - try it! Ahora puedes viajar entre esas sucursales fácilmente (usando `git checkout`). ¡Pruébalo!
Your friend is happy that you made it to the birthday party and you also got your concert ticket signed. Yay! Tu amigo está feliz de que hayas podido asistir a la fiesta de cumpleaños y de que también hayas firmado tu entrada para el concierto. ¡Hurra!

View file

@ -1,47 +1,47 @@
title = Deleting branches título = Eliminando ramas
cards = checkout commit-auto reset-hard branch-delete tarjetas = pago confirmar-restablecimiento automático-eliminación completa de rama
[description] [descripción]
Life is full of dangers, right? Even when walking to school, it seems like there's a lot of risks! La vida está llena de peligros, ¿verdad? ¡Incluso cuando caminas hacia la escuela, parece que hay muchos riesgos!
This Monday is especially bad. You made it to school, but there's some timelines you definitely don't want to keep around. Este lunes es especialmente malo. Llegaste a la escuela, pero hay algunas líneas de tiempo que definitivamente no quieres mantener.
[setup] [configuración]
echo You leave your house and start walking to school. > you echo Sales de tu casa y empiezas a caminar hacia la escuela. > tu
git add . git agregar.
git commit -m "Good morning!" git commit -m "¡Buenos días!"
echo You walk on the right side of the street. >> you echo Caminas por el lado derecho de la calle. >> tu
git commit -am "Right side" git commit -am "Lado derecho"
echo You jump over an manhole in the walkway, and arrive at school on time. >> you echo Saltas sobre una alcantarilla en la pasarela y llegas a la escuela a tiempo. >> tu
git commit -am "Jump" git commit -am "Saltar"
git checkout HEAD^ -b friend git checkout HEAD^ -b amigo
echo Suddenly, you fall down, splash into stinking water, and are eaten by an alligator. >> you echo De repente, te caes, te sumerges en agua apestosa y eres devorado por un caimán. >> tu
git commit -am "A new friend" git commit -am "Un nuevo amigo"
git checkout HEAD~2 -b music git checkout HEAD~2 -b música
echo You walk on the left side of the street. >> you echo Caminas por el lado izquierdo de la calle. >> tu
git commit -am "Left side" git commit -am "Lado izquierdo"
echo Because you\'re kind of late, you start running. Someone throws a piano out of their windows, and it smashes you. >> you echo Como llegas un poco tarde, empiezas a correr. Alguien arroja un piano por la ventana y te destroza. >> tu
git commit -am "Sounds nice" git commit -am "Suena bien"
git checkout HEAD^ -b ice-cream git checkout HEAD^ -b helado
echo You\'re not in a hurry, and walk slowly. You even get some ice cream on your way. You arrive at school too late, your teacher is angry, and you are expelled. >> you echo No tienes prisa y camina despacio. Incluso conseguirás un helado en el camino. Llegas demasiado tarde a la escuela, tu profesor se enoja y te expulsan. >> tu
git commit -am "Yum" git commit -am "Yum"
git branch -M main leap rama git -M salto principal
git checkout leap^^ salto de pago de git ^^
[win] [ganar]
# Find the bad branches and delete them. Keep only the best one. # Encuentra las ramas defectuosas y elimínalas. Quédate sólo con el mejor.
test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)" test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)"
[congrats] [felicitaciones]
On second thought, maybe you even prefer the ice cream timeline to the main one? :) Pensándolo bien, ¿tal vez incluso prefieras la línea de tiempo del helado a la principal? :)

View file

@ -1,43 +1,43 @@
title = Moving through time título = Moviéndose a través del tiempo
cards = checkout commit-auto tarjetas = pago confirmar-auto
[description] [descripción]
The yellow boxes are frozen points in time, we call them "commits"! You can travel between them using the "checkout" card! (Try it!) Los cuadros amarillos son puntos congelados en el tiempo, ¡los llamamos "compromisos"! ¡Puedes viajar entre ellos usando la tarjeta "checkout"! (¡Intentalo!)
Can you find out what happened here? Then, while on the last commit, edit the files to fix the problem, and make a new commit! ¿Puedes descubrir qué pasó aquí? Luego, durante la última confirmación, edite los archivos para solucionar el problema y realice una nueva confirmación.
[cli] [cli]
To checkout a specific commit, type `git checkout`, then a space, and then right click on the commit you want! Para verificar una confirmación específica, escriba `git checkout`, luego un espacio y luego haga clic derecho en la confirmación que desee.
This will insert the commit's unique identifier! ¡Esto insertará el identificador único de la confirmación!
[setup] [configuración]
echo "This piggy bank belongs to the big sister. echo "Esta alcancía pertenece a la hermana mayor.
It contains 10 coins." > piggy_bank Contiene 10 monedas." > alcancía
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
echo "A young girl with brown, curly hair." > little_sister echo "Una joven de cabello castaño y rizado". > hermanita_pequeña
git add . git agregar.
git commit -m "Little sister comes in" git commit -m "Entra la hermana pequeña"
echo "Has 10 coins." >> little_sister echo "Tiene 10 monedas." >> hermanita_pequeña
echo "This piggy bank belongs to the big sister. echo "Esta alcancía pertenece a la hermana mayor.
It is empty." > piggy_bank Está vacío." > alcancía
git add . git agregar.
git commit -m "Little sister does something" git commit -m "La hermana pequeña hace algo"
git checkout HEAD^^ git checkout CABEZA^^
git branch -df main rama git -df principal
[win] [ganar]
# Restore sisterly peace. # Restaurar la paz fraternal.
{ git show HEAD:piggy_bank | grep "10 coins"; } && { git show HEAD:little_sister | grep -v "10 coins"; } && { git rev-parse HEAD^^^; } { git show HEAD:piggy_bank | grep "10 monedas"; } && { git show HEAD:hermana_pequeña | grep -v "10 monedas"; } && { git rev-parse HEAD^^^; }
[congrats] [felicitaciones]
Wonderful! Now that you're getting familiar with the time machine, let's look at some more complicated situations... ¡Maravilloso! Ahora que te estás familiarizando con la máquina del tiempo, veamos algunas situaciones más complicadas...

View file

@ -1,65 +1,65 @@
title = Make parallel commits title = Realizar confirmaciones paralelas
cards = checkout commit-auto tarjetas = pago confirmar-auto
[description] [descripción]
Did you know that creating parallel timelines is perfectly legal and safe? It's true! ¿Sabías que crear líneas de tiempo paralelas es perfectamente legal y seguro? ¡Es cierto!
Can you find out when things went wrong in this zoo? Then, go back to the last good commit and create a parallel universe where everyone is happy! ¿Puedes descubrir cuándo salieron mal las cosas en este zoológico? Luego, regresa al último compromiso bueno y crea un universo paralelo donde todos sean felices.
[cli] [cli]
The blue animal represents a concept known as the "HEAD pointer" in Git: It shows you which commit is the current one. El animal azul representa un concepto conocido como "puntero HEAD" en Git: muestra cuál confirmación es la actual.
Here's a cool trick to go to the previous commit: Aquí hay un truco genial para ir a la confirmación anterior:
git checkout HEAD^ git checkout CABEZA^
You can also go back two commits by typing, for example: También puedes retroceder dos confirmaciones escribiendo, por ejemplo:
git checkout HEAD~2 git pago CABEZA~2
[setup] [configuración]
mkdir cage jaula mkdir
echo "Looks very hungry." > cage/lion echo "Parece tener mucha hambre." > jaula/león
echo "A small child. echo "Un niño pequeño.
It really loves cats!" > child ¡Le encantan los gatos!" > niño
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
echo "It's holding a lollipop." >> child echo "Está sosteniendo una paleta". >> niño
git commit -am "The child buys something" git commit -am "El niño compra algo"
mv child cage jaula infantil mv
git add . git agregar.
git commit -m "The child climbs somewhere" git commit -m "El niño sube a alguna parte"
git rm cage/child git rm jaula/niño
echo "Looks happy. :)" > cage/lion echo "Parece feliz. :)" > jaula/león
git add . git agregar.
git commit -m "Oh no" git commit -m "Oh, no"
echo "It's sleeping." > cage/lion echo "Está durmiendo". > jaula/león
git add . git agregar.
git commit -m "Nap time!" git commit -m "¡Hora de la siesta!"
git checkout --detach git checkout --separar
git branch -d main git rama -d principal
[win] [ganar]
# Make sure that the child is happy. # Asegúrese de que el niño esté feliz.
git ls-tree --name-only -r HEAD | grep child git ls-tree --name-only -r HEAD | niño grep
# Make sure that the lion gets something to eat. # Asegúrate de que el león tenga algo de comer.
git show HEAD:cage/lion | grep -v "very hungry" git show HEAD:jaula/león | grep -v "mucha hambre"
[congrats] [felicitaciones]
Whew, good job! This seems like a *much* better outcome. ¡Buen trabajo! Esto parece un resultado *mucho* mejor.
Feel free to add more parallel timelines, or make them longer. Siéntase libre de agregar más líneas de tiempo paralelas o hacerlas más largas.
If you're ready, our next mission is already waiting... Si estás listo, nuestra próxima misión ya te está esperando...

View file

@ -1,49 +1,49 @@
title = Branches grow with you! title = ¡Las ramas crecen contigo!
cards = checkout commit-auto branch branch-delete reset-hard tarjetas = pago confirmar-auto rama-eliminar rama restablecer-hard
[description] [descripción]
Note that there are two options to "travel to the end of a timeline": Tenga en cuenta que hay dos opciones para "viajar hasta el final de una línea de tiempo":
First, you can directly travel to the commit, like we've done it before. Primero, puede viajar directamente al compromiso, como lo hemos hecho antes.
And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline! Y en segundo lugar, puedes viajar hasta la etiqueta de la sucursal. En este caso, cuando hagas una nueva confirmación, la rama crecerá contigo y seguirá apuntando al final de la línea de tiempo.
[cli] [cli]
To travel to a branch, type `git checkout name_of_the_branch`. Para viajar a una sucursal, escriba `git checkout nombre_de_la_sucursal`.
And to travel to the last commit, type `git checkout --detach name_of_the_branch`. Y para viajar a la última confirmación, escriba `git checkout --detach name_of_the_branch`.
[setup] [configuración]
echo "You wrap the birthday present, and grab your concert ticket." > you echo "Envuelves el regalo de cumpleaños y tomas tu entrada para el concierto". > tu
git add . git agregar.
git commit -m "Evening preparations" git commit -m "Preparativos de la tarde"
echo "You go to the birthday party!" >> you echo "¡Vas a la fiesta de cumpleaños!" >> tu
git add . git agregar.
git commit -m "Go to the birthday" git commit -m "Ir al cumpleaños"
git branch birthday cumpleaños de la rama git
git checkout HEAD~1 git pago CABEZA~1
echo "You go to the concert!" > you echo "¡Vas al concierto!" > tu
git add . git agregar.
git commit -m "Go to the concert" git commit -m "Ir al concierto"
git branch concert concierto de la rama git
git checkout HEAD~1 git pago CABEZA~1
git branch -D main rama git -D principal
[win] [ganar]
# Travel directly to the last yellow commit of the birthday timeline, make a change to 'you', and make a commit # Viaja directamente al último compromiso amarillo de la línea de tiempo del cumpleaños, haz un cambio a "tú" y realiza un compromiso
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
if test $(git rev-parse $commit^) = $(git rev-parse birthday); then si prueba $(git rev-parse $commit^) = $(git rev-parse cumpleaños); entonces
return 0 regresar 0
fi fi
done hecho
return 1 regresar 1
# Travel to the blue 'concert' branch, make a change to 'you', and a commit. # Viaja a la rama azul 'concierto', haz un cambio en 'tú' y confirma.
git show concert^ | grep "Go to the concert" concierto de espectáculo de git ^ | grep "Ir al concierto"

View file

@ -1,89 +1,89 @@
title = Moving branches around title = Moviendo ramas alrededor
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
One of your colleagues messed up here, and put the branches in the wrong timelines! ¡Uno de tus colegas se equivocó aquí y colocó las ramas en los plazos equivocados!
You could delete and re-create these branches - but you can also directly move them to different commits, by using Puede eliminar y volver a crear estas ramas, pero también puede moverlas directamente a diferentes confirmaciones mediante el uso
git checkout git pago
on the branch names, and then using en los nombres de las ramas, y luego usando
git reset --hard reinicio de git --duro
on the commit where you want the branch to be. en el compromiso donde desea que esté la rama.
The donut branch is in the right place, but the timeline is still incomplete - make you actually *eat* the donut in that branch! La rama de donas está en el lugar correcto, pero la línea de tiempo aún está incompleta. ¡Haz que *te comas* la dona en esa rama!
[setup] [configuración]
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "The Beginning" git commit -m "El comienzo"
git checkout -b coffee git pago -b café
echo "You have a baguette. echo "Tienes una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy a baguette" git commit -m "Compras una baguette"
echo "You ate a baguette. echo "Te comiste una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You eat the baguette" git commit -m "Te comes la baguette"
git checkout -b baguette main git checkout -b baguette principal
echo "You do not have a baguette. echo "No tienes baguette.
You have coffee. Tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy some coffee" git commit -m "Compras un poco de café"
echo "You do not have a baguette. echo "No tienes baguette.
You drank coffee. Bebiste café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You drink the coffee" git commit -m "Tú bebes el café"
git checkout -b donut main git checkout -b donut principal
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You have a donut." > you Tienes un donut." > tú
git add . git agregar.
git commit -m "You buy a donut" git commit -m "Compras una dona"
git checkout --detach main git checkout --separar principal
[win] [ganar]
# Did you eat a baguette on the baguette branch? # ¿Te comiste una baguette en la rama de baguette?
git show baguette:you | grep "You ate.*baguette" git show baguette:tú | grep "Comiste.*baguette"
# Did you drink a coffee on the coffee branch? # ¿Tomaste un café en la rama del café?
git show coffee:you | grep "You drank.*coffee" git show café:tú | grep "Bebiste.*café"
# Did you eat a donut on the donut branch? # ¿Te comiste una rosquilla en la rama de rosquilla?
git show donut:you | grep "You ate.*donut" git show donut:tú | grep "Comiste.*dona"
[actions] [comportamiento]
test "$(git rev-parse HEAD^)" = "$(git rev-parse donut)" && hint "Remember to checkout the blue branch tag when you want it to grow with the timeline." test "$(git rev-parse HEAD^)" = "$(git rev-parse donut)" && sugerencia "Recuerda revisar la etiqueta de rama azul cuando quieras que crezca con la línea de tiempo".

View file

@ -1,6 +1,6 @@
checkout-commit compromiso de pago
fork tenedor
branch-create crear rama
grow crecer
branch-remove eliminar rama
reorder reordenar

View file

@ -1,86 +1,86 @@
title = Rebasing título = Rebase
cards = checkout commit-auto reset-hard rebase tarjetas = pago compromiso-restablecimiento automático-rebase completa
[description] [descripción]
Okay - turns out that saving time in the morning by utilizing parallel universes is against the regulations of the International Time Travel Association. You'll have to do your tasks in sequence after all. Bien, resulta que ahorrar tiempo por la mañana utilizando universos paralelos va en contra de las regulaciones de la Asociación Internacional de Viajes en el Tiempo. Después de todo, tendrás que hacer tus tareas en secuencia.
See the "rebase" card? When you drag it to a commit, it will copy the events in your current timeline after the specified one! This way, make a clean, linear timeline where you visit all three shops. ¿Ves la tarjeta de "rebase"? Cuando lo arrastras a una confirmación, copiará los eventos en tu línea de tiempo actual después del especificado. De esta manera, cree una línea de tiempo limpia y lineal en la que visite las tres tiendas.
Again, we want to make that our base reality - the "main" branch should point to that timeline! Nuevamente, queremos que esa sea nuestra realidad básica: ¡la rama "principal" debe apuntar a esa línea de tiempo!
[setup] [configuración]
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "The Beginning" git commit -m "El comienzo"
git checkout -b baguette main git checkout -b baguette principal
echo "You have a baguette. echo "Tienes una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy a baguette" git commit -m "Compras una baguette"
echo "You ate a baguette. echo "Te comiste una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You eat the baguette" git commit -m "Te comes la baguette"
git checkout -b coffee main git checkout -b café principal
echo "You do not have a baguette. echo "No tienes baguette.
You have coffee. Tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy some coffee" git commit -m "Compras un poco de café"
echo "You do not have a baguette. echo "No tienes baguette.
You drank coffee. Bebiste café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You drink the coffee" git commit -m "Tú bebes el café"
git checkout -b donut main git checkout -b donut principal
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You have a donut." > you Tienes un donut." > tú
git add . git agregar.
git commit -m "You buy a donut" git commit -m "Compras una dona"
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You ate a donut." > you Te comiste un donut." > tú
git add . git agregar.
git commit -m "You eat the donut" git commit -m "Te comes el donut"
git checkout --detach main git checkout --separar principal
[win] [ganar]
# Order all tree branches into one and move the main branch ref # Ordena todas las ramas de los árboles en una y mueve la rama principal ref.
{ git show main:you | grep "You ate.*baguette"; } && { git show main:you | grep "You drank.*coffee"; } && { git show main:you | grep "You ate.*donut"; } && { test "$(git log main --oneline | wc -l)" -eq 7; } { git show principal:tú | grep "Comiste.*baguette"; } && { git show main:tú | grep "Bebiste.*café"; } && { git show main:tú | grep "Comiste.*dona"; } && { prueba "$(git log main --oneline | wc -l)" -eq 7; }
[congrats] [felicitaciones]
Notice how the other timelines and commits are still there - if anything goes wrong, you can also travel back to them. Observe cómo las otras líneas de tiempo y confirmaciones todavía están allí; si algo sale mal, también puede regresar a ellas.
It's really hard to actually *destroy* stuff with your time machine. Es realmente difícil *destruir* cosas con tu máquina del tiempo.

View file

@ -1,78 +1,78 @@
title = Reordering events título = Reordenar eventos
cards = checkout commit-auto reset-hard rebase-interactive cherry-pick tarjetas = pago compromiso-restablecimiento automático-rebase duro-selección interactiva
[description] [descripción]
Oops, looks like there's something messed up here. Can you put the events back into their correct order? Ups, parece que hay algo mal aquí. ¿Puedes volver a poner los eventos en el orden correcto?
There are two ways to do this: You can drag the "interactive rebase" card to the commit before the one you want to change, then reorder the lines in the file that opens, and save it. Hay dos formas de hacer esto: puede arrastrar la tarjeta "rebase interactiva" a la confirmación antes de la que desea cambiar, luego reordenar las líneas en el archivo que se abre y guardarlo.
Or you can reset the main tag to the very first commit, and then cherry-pick single commits in the order you want. You have cards for both approaches! O puede restablecer la etiqueta principal a la primera confirmación y luego seleccionar confirmaciones individuales en el orden que desee. ¡Tienes cartas para ambos enfoques!
[setup] [configuración]
echo "You just woke up. echo "Acabas de despertar.
You are NOT wearing underwear. NO estás usando ropa interior.
You are NOT wearing pants. NO llevas pantalones.
You are NOT wearing a shirt. NO llevas camisa.
You are NOT wearing shoes." > you NO estás usando zapatos." > tú
git add . git agregar.
git commit -m "The Beginning" git commit -m "El comienzo"
echo "You just woke up. echo "Acabas de despertar.
You are NOT wearing underwear. NO estás usando ropa interior.
You are NOT wearing pants. NO llevas pantalones.
You are NOT wearing a shirt. NO llevas camisa.
You are wearing shoes." > you Estás usando zapatos." > tú
git commit -am "Put on shoes" git commit -am "Ponte los zapatos"
echo "You just woke up. echo "Acabas de despertar.
You are NOT wearing underwear. NO estás usando ropa interior.
You are wearing pants. Estás usando pantalones.
You are NOT wearing a shirt. NO llevas camisa.
You are wearing shoes." > you Estás usando zapatos." > tú
git commit -am "Put on pants" git commit -am "Ponte los pantalones"
echo "You just woke up. echo "Acabas de despertar.
You are wearing underwear. Estás usando ropa interior.
You are wearing pants. Estás usando pantalones.
You are NOT wearing a shirt. NO llevas camisa.
You are wearing shoes." > you Estás usando zapatos." > tú
git commit -am "Put on underwear" git commit -am "Ponte ropa interior"
echo "You just woke up. echo "Acabas de despertar.
You are wearing underwear. Estás usando ropa interior.
You are wearing pants. Estás usando pantalones.
You are wearing a shirt. Estás usando una camisa.
You are wearing shoes." > you Estás usando zapatos." > tú
git commit -am "Put on shirt" git commit -am "Ponte la camisa"
[win] [ganar]
# Reorder the commits to dress yourself in the correct way # Reordena los commits para vestirte de la forma correcta
{ git log main --oneline | perl -0777 -ne'exit(1) if not /shoes[\s\S]*pants[\s\S]*underwear/'; } && { test "$(git log main --oneline | wc -l)" -eq 5; } { git log principal --oneline | perl -0777 -ne'exit(1) si no /zapatos[\s\S]*pantalones[\s\S]*ropa interior/'; } && { prueba "$(git log main --oneline | wc -l)" -eq 5; }
[congrats] [felicitaciones]
Feel free to reset the level and try the other strategy! Which one do you like better? ¡Siéntete libre de restablecer el nivel y probar la otra estrategia! ¿Cuál te gusta más?

View file

@ -1,2 +1,2 @@
rebase rebase
reorder reorder

View file

@ -1,32 +1,32 @@
title = Interior design título = Diseño de interiores
cards = file-new file-delete tarjetas = archivo-nuevo archivo-eliminar
[description] [descripción]
Now that your room looks tidy, you can start to unpack your stuff. You brought two new pieces of furniture with you and with a bright smile, Ahora que tu habitación luce ordenada, puedes comenzar a desempacar tus cosas. Trajiste dos muebles nuevos y con una sonrisa brillante,
you see that their colors match the color of your bed! ¡Ya ves que sus colores combinan con el color de tu cama!
Build up your two pieces of furniture by playing the touch card. Construye tus dos muebles jugando la carta táctil.
Then name your furniture - you can choose whatever you like. Luego, ponle un nombre a tus muebles; puedes elegir el que quieras.
Make sure the colors match! You can find the bed's color in its description. ¡Asegúrate de que los colores combinen! Puedes encontrar el color de la cama en su descripción.
Don't forget to add a color and description to your new furnitures, too! ¡No olvides agregar también un color y una descripción a tus nuevos muebles!
[setup] [configuración]
echo A yellow cozy bed. > bed echo Una acogedora cama amarilla. > cama
[win] [ganar]
# Add two more pieces of furniture # Agrega dos muebles más
NUM_FILES="$(ls | wc -l)" NUM_FILES="$(ls | baño -l)"
test "$NUM_FILES" -ge 3 prueba "$NUM_FILES" -ge 3
# Make sure the colors match your bed's color. # Asegúrese de que los colores coincidan con el color de su cama.
NUM_FILES="$(ls | wc -l)" NUM_FILES="$(ls | baño -l)"
YELLOW_FILES="$(grep -li yellow * | wc -l)" YELLOW_FILES="$(grep -li amarillo * | wc -l)"
test "$NUM_FILES" -ge 2 && test "$YELLOW_FILES" = "$NUM_FILES" prueba "$NUM_FILES" -ge 2 && prueba "$YELLOW_FILES" = "$NUM_FILES"
[congrats] [felicitaciones]
Don't you immediately feel more at home? ¿No te sientes inmediatamente más como en casa?

View file

@ -1,36 +1,36 @@
title = Unexpected Roommates título = Compañeros de cuarto inesperados
cards = file-delete tarjetas = eliminar archivo
[description] [descripción]
The first day at Time Travel School comes to an end and you receive the key to your room. El primer día en Time Travel School llega a su fin y recibes la llave de tu habitación.
Full of excitement you open the door just to find... spider webs! Spider webs everywhere! Lleno de emoción abres la puerta sólo para encontrar... ¡telas de araña! ¡Telaras de araña por todas partes!
Remove all the spider webs you can find with the remove card! ¡Elimina todas las telarañas que puedas encontrar con la tarjeta de eliminación!
[cli] [cli]
On the command line, you can easily delete all files ending in -web using this command: En la línea de comando, puedes eliminar fácilmente todos los archivos que terminan en -web usando este comando:
rm *web habitación *web
[setup] [configuración]
echo A tiny spider web is next to your window. > tiny_web echo Una pequeña telaraña está al lado de tu ventana. > pequeña_web
echo A big spider web sticks above your bed. > big_web echo Una gran telaraña cuelga encima de tu cama. > gran_web
echo A cozy bed. > bed eco Una cama acogedora. > cama
echo An extra thick spider web is right beside your door. > thick_web echo Una telaraña extra gruesa está justo al lado de tu puerta. > red_gruesa
[win] [ganar]
# Remove all spider webs. # Retire todas las telas de araña.
! ls | grep thick_web && ! ls | grep web_gruesa &&
! ls | grep big_web && ! ls | grep big_web &&
! ls | grep tiny_web ! ls | grep tiny_web
# But make sure you keep your bed! # ¡Pero asegúrate de quedarte en tu cama!
ls | grep bed ls | cama grep
[congrats] [felicitaciones]
Your room looks now very tidy and cozy! Time to unpack your stuff! ¡Tu habitación ahora se ve muy ordenada y acogedora! ¡Es hora de desempacar tus cosas!

View file

@ -1,3 +1,2 @@
files-delete eliminar archivos
files-add agregar archivos

View file

@ -1,38 +1,38 @@
title = Updating files in the index title = Actualizando archivos en el índice
cards = add commit checkout tarjetas = agregar confirmación de pago
[description] [descripción]
So you start working, and make changes to your files! Git lets you choose which of these changes you want to put in the next commit. This is like updating the index version of that file to the new version. ¡Así que comienza a trabajar y realiza cambios en tus archivos! Git te permite elegir cuál de estos cambios deseas realizar en la siguiente confirmación. Esto es como actualizar la versión de índice de ese archivo a la nueva versión.
This allows you to have smaller commits, that describe better what you changed! ¡Esto le permite tener confirmaciones más pequeñas que describen mejor lo que cambió!
The command for this is the same - `git add`! El comando para esto es el mismo: ¡`git add`!
[setup] [configuración]
echo a > a eco a > a
echo b > b eco b > b
echo c > c eco c > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
[win] [ganar]
# Make changes to all files! # ¡Haz cambios en todos los archivos!
test "$(cat a)" != "a" && prueba "$(cat a)" != "a" &&
test "$(cat b)" != "b" && prueba "$(cat b)" != "b" &&
test "$(cat c)" != "c" prueba "$(cat c)" != "c"
# Add only the changes of a and c, and make a commit! Finally, make a commit which captures the changes in b! # ¡Agregue solo los cambios de a y c, y haga una confirmación! Finalmente, haga una confirmación que capture los cambios en b!
test "$(git show main:a)" != "a" && prueba "$(git show main:a)" != "a" &&
test "$(git show main:b)" != "b" && prueba "$(git show main:b)" != "b" &&
test "$(git show main:c)" != "c" && prueba "$(git show main:c)" != "c" &&
test "$(git show main^:a)" != "a" && prueba "$(git show main^:a)" != "a" &&
test "$(git show main^:b)" == "b" && prueba "$(git show main^:b)" == "b" &&
test "$(git show main^:c)" != "c" prueba "$(git show main^:c)" != "c"
[congrats] [felicitaciones]
Well done! Try travelling between the commits using `git checkout`, so you can look at their contents again! ¡Bien hecho! Intente viajar entre las confirmaciones usando `git checkout`, ¡para que pueda ver su contenido nuevamente!

View file

@ -1,31 +1,31 @@
title = Update files in the index title = Actualizar archivos en el índice
cards = add commit tarjetas = agregar compromiso
[description] [descripción]
When we change files, the index won't change on its own. We have to use `git add` to update the index to the changed version of the file. Cuando cambiamos archivos, el índice no cambiará por sí solo. Tenemos que usar `git add` para actualizar el índice a la versión modificada del archivo.
Let's try that! ¡Intentemos eso!
The icons in the file browser show you when the actual file (white) and the version in the index (blue) are different, and when they are the same! Los íconos en el explorador de archivos le muestran cuándo el archivo real (blanco) y la versión en el índice (azul) son diferentes y cuándo son iguales.
[win] [ganar]
Good! The index is sometimes also called the "staging area" - it contains exactly what ends up in the next commit when you use `git commit`! ¡Bien! El índice a veces también se denomina "área de preparación": ¡contiene exactamente lo que termina en la siguiente confirmación cuando usas `git commit`!
[setup] [configuración]
echo "The candle is burning with a blue flame." > candle echo "La vela arde con una llama azul". > vela
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
[win] [ganar]
# Make a change to the candle. # Haz un cambio en la vela.
test "$(git diff --name-only)" = "candle" || file -f .git/candle-changed && touch .git/candle-changed prueba "$(git diff --name-only)" = "vela" || archivo -f .git/vela-cambiada && toque .git/vela-cambiada
# Add the candle. # Agrega la vela.
test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added prueba "$(git diff --cached --name-only)" = "vela" || archivo -f .git/vela-añadida && toque .git/vela-añadida
# Make a commit. # Haz un compromiso.
test "$(git diff --name-only HEAD HEAD^)" = "candle" prueba "$(git diff --name-only HEAD HEAD^)" = "vela"

View file

@ -1,25 +1,25 @@
title = Checking out files from the index title = Extraer archivos del índice
cards = add reset-file checkout-file commit tarjetas = agregar confirmación de archivo de reinicio de archivo de pago
[description] [descripción]
So you've made changes to your files, but you decide that you don't want to keep them! You can use `git checkout` for that! ¡Has realizado cambios en tus archivos, pero decides que no quieres conservarlos! ¡Puedes usar `git checkout` para eso!
What happens if you have already update the index, like in file c? You have to reset the index first! ¿Qué sucede si ya actualizó el índice, como en el archivo c? ¡Primero tienes que restablecer el índice!
[setup] [configuración]
echo a > a eco a > a
echo b > b eco b > b
echo c > c eco c > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo x > a eco x > a
echo x > b eco x > b
echo x > c eco x > c
git add c git agregar c
[win] [ganar]
# Remove all changes in your local files! # ¡Elimina todos los cambios en tus archivos locales!
test "$(git diff --name-only | wc -l)" -eq 0 prueba "$(git diff --name-only | wc -l)" -eq 0

View file

@ -1,51 +1,51 @@
title = Step by step título = Paso a paso
cards = checkout commit-auto tarjetas = pago confirmar-auto
[description] [descripción]
Welcome to today's lesson! We're going to learn how to make commits with more precision! ¡Bienvenidos a la lección de hoy! ¡Aprenderemos a realizar confirmaciones con más precisión!
Have a look at these two timelines. They have exactly the same outcome. But one of them makes it much easier to figure out what happened. Eche un vistazo a estas dos líneas de tiempo. Tienen exactamente el mismo resultado. Pero uno de ellos hace que sea mucho más fácil descubrir qué pasó.
[win] [ganar]
# Right! Having each change in its own commit makes it easier to understand what's going on! Let's learn how to do that! # ¡Bien! ¡Tener cada cambio en su propio compromiso hace que sea más fácil entender lo que está pasando! ¡Aprendamos cómo hacer eso!
git branch --show-current | grep step-by-step rama git --show-current | grep paso a paso
[setup] [configuración]
echo "A small, but heavy glass ball." > ball echo "Una bola de cristal pequeña pero pesada". > pelota
echo "A thin book, that's standing upright." > book echo "Un libro delgado, que está de pie". > libro
echo "A candle, burning with a blue flame." > candle echo "Una vela ardiendo con una llama azul". > vela
echo "A smoke detector. It's absolutely silent." > smoke_detector echo "Un detector de humo. Es absolutamente silencioso." > detector_de_humo
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
git branch -M all-at-once rama git -M todo a la vez
echo "The ball is now touching the book." > ball echo "La pelota ahora toca el libro". > pelota
echo "The book has fallen over." > book echo "El libro se ha caído." > libro
echo "The candle has been blown out." > candle echo "La vela se ha apagado". > vela
git commit -am "The end" git commit -am "El fin"
git checkout HEAD^ git checkout CABEZA^
git checkout -b step-by-step git checkout -b paso a paso
echo "The ball is now touching the book." > ball echo "La pelota ahora toca el libro". > pelota
git commit -am "The ball rolls towards the book" git commit -am "La pelota rueda hacia el libro"
echo "The book has fallen over." > book echo "El libro se ha caído." > libro
git commit -am "The book falls over" git commit -am "El libro se cae"
echo "The candle has been blown out." > candle echo "La vela se ha apagado". > vela
git commit -am "The book blows out the candle" git commit -am "El libro apaga la vela"
git checkout HEAD~3 git pago CABEZA ~ 3
[win] [ganar]
# Pick the timeline that's clearer, and make the alarm go off! # ¡Elija la línea de tiempo que sea más clara y haga sonar la alarma!
git show step-by-step:smoke_detector | tail -n 1 | grep -v "absolutely silent" git muestra paso a paso: detector_de_humo | cola -n 1 | grep -v "absolutamente silencioso"

View file

@ -1,28 +1,28 @@
title = Add new files to the index title = Agregar nuevos archivos al índice
cards = add commit tarjetas = agregar compromiso
[description] [descripción]
So far, when we made a commit, we've always recorded the current status of all objects, right? Hasta ahora, cuando hicimos una confirmación, siempre registramos el estado actual de todos los objetos, ¿verdad?
But Git allows you to pick which changes you want to put in a commit! ¡Pero Git te permite elegir qué cambios deseas realizar en una confirmación!
To learn how that works, we need to learn about the "index"! In the index, we can prepare what will be in the next commit. In this game, the index is represented by a blue aura around icons in the file browser! Para saber cómo funciona, ¡necesitamos aprender sobre el "índice"! En el índice, podemos preparar lo que habrá en la próxima confirmación. ¡En este juego, el índice está representado por un aura azul alrededor de los íconos en el explorador de archivos!
Initially, the index is empty. To make a commit that contains a new file, we need to add it! Inicialmente, el índice está vacío. Para realizar una confirmación que contenga un archivo nuevo, ¡debemos agregarlo!
[cli] [cli]
You can use tab completion in the terminal! Start typing a filename, then press the tab key to complete its name. This will often save you some time! ¡Puedes usar la función de completar tabulaciones en la terminal! Comience a escribir un nombre de archivo, luego presione la tecla tab para completar su nombre. ¡Esto a menudo le ahorrará algo de tiempo!
[setup] [configuración]
echo "The candle is burning with a blue flame." > candle echo "La vela arde con una llama azul". > vela
[win] [ganar]
# Add the candle. # Agrega la vela.
test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added prueba "$(git diff --cached --name-only)" = "vela" || archivo -f .git/vela-añadida && toque .git/vela-añadida
# Make a commit. # Haz un compromiso.
test "$(git ls-tree --name-only HEAD)" = "candle" prueba "$(git ls-tree --name-only HEAD)" = "vela"

View file

@ -1,37 +1,37 @@
title = Resetting files in the index title = Restablecer archivos en el índice
cards = add reset-file commit tarjetas = agregar confirmación de reinicio de archivo
[description] [descripción]
See the dark shadow behind the icons? That's the version of the file in the last commit! ¿Ves la sombra oscura detrás de los íconos? ¡Esa es la versión del archivo en la última confirmación!
For example, these candles have been blown out, and that change has been added. Por ejemplo, estas velas se han apagado y se ha añadido ese cambio.
But you decide that this was a mistake! You only want to blow out the red candle in the next commit! ¡Pero decides que esto fue un error! ¡Solo quieres apagar la vela roja en el próximo compromiso!
If you already have updated the index to a changed file, but want to reset it, you can use `git reset`! Si ya actualizó el índice a un archivo modificado, pero desea restablecerlo, puede usar `git reset`.
[setup] [configuración]
echo "It's burning!" > red_candle echo "¡Está ardiendo!" > vela_roja
echo "It's burning!" > green_candle echo "¡Está ardiendo!" > vela_verde
echo "It's burning!" > blue_candle echo "¡Está ardiendo!" > vela_azul
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
echo "It's been blown out." > red_candle echo "Se ha apagado". > vela_roja
echo "It's been blown out." > green_candle echo "Se ha apagado". > vela_verde
echo "It's been blown out." > blue_candle echo "Se ha apagado". > vela_azul
git add . git agregar.
[win] [ganar]
# Reset the changes in the green and blue candles! # ¡Restablece los cambios en las velas verdes y azules!
git show :green_candle | grep burning && espectáculo de git: green_candle | grep quemando &&
git show :blue_candle | grep burning && espectáculo de git: blue_candle | grep quemando &&
git show :red_candle | grep -v burning espectáculo de git: red_candle | grep -v quemando
# And make a commit! # ¡Y haz un compromiso!
git show main:green_candle | grep burning && git show principal:green_candle | grep quemando &&
git show main:blue_candle | grep burning && git show principal:blue_candle | grep quemando &&
git show main:red_candle | grep -v burning git show principal:red_candle | grep -v quemando

View file

@ -1,24 +1,24 @@
title = Delete a file in the next commit title = Eliminar un archivo en la próxima confirmación
cards = add reset-file checkout-file rm file-delete commit cards = agregar restablecer-archivo-archivo-de-compra-rm archivo-eliminar confirmación
[description] [descripción]
If you want to remove a file in the next commit, you can use `git rm`! This will both delete the file locally, and in the index. Si desea eliminar un archivo en la próxima confirmación, ¡puede usar `git rm`! Esto eliminará el archivo localmente y en el índice.
If a file is modified, you'll need to reset these changes first/reset the files. Si se modifica un archivo, primero deberá restablecer estos cambios/restablecer los archivos.
[setup] [configuración]
echo a > a eco a > a
echo x > b eco x > b
echo x > c eco x > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo x > a eco x > a
echo b > b eco b > b
git add b git agregar b
[win] [ganar]
# Make a commit where all files are deleted ¯\_(^_^)_/¯ # Realizar una confirmación donde se eliminan todos los archivos ¯\_(^_^)_/¯
test "$(git ls-tree main | wc -l)" -eq 0 prueba "$(git ls-tree main | wc -l)" -eq 0

View file

@ -1,5 +1,5 @@
compare comparar
new nuevo
change cambiar
reset reiniciar
steps pasos

View file

@ -1,53 +1,53 @@
title = Adding changes step by step title = Agregar cambios paso a paso
cards = add reset-file commit tarjetas = agregar confirmación de reinicio de archivo
[description] [descripción]
The index is really useful, because it allows us to be precise about which changes we want to include in each commit! ¡El índice es realmente útil porque nos permite ser precisos sobre qué cambios queremos incluir en cada confirmación!
[setup] [configuración]
echo "A hammer, balancing on its handle." > hammer echo "Un martillo, balanceándose sobre su mango". > martillo
echo "A bottle, containing a clear liquid." > bottle echo "Una botella que contiene un líquido transparente". > botella
echo "A white sugar cube." > sugar_cube echo "Un terrón de azúcar blanco". > cubo_de_azúcar
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
[win] [ganar]
# Make changes to all three objects, to form a logical sequence of events! # ¡Realice cambios en los tres objetos para formar una secuencia lógica de eventos!
test "$(git diff --name-only | wc -l)" -eq 3 || file -f .git/candle-changed && touch .git/candle-changed prueba "$(git diff --name-only | wc -l)" -eq 3 || archivo -f .git/vela-cambiada && toque .git/vela-cambiada
# Only add one of these changes! # ¡Agregue solo uno de estos cambios!
test "$(git diff --cached --name-only | wc -l)" -eq 1 || file -f .git/candle-added && touch .git/candle-added prueba "$(git diff --cached --name-only | wc -l)" -eq 1 || archivo -f .git/vela-añadida && toque .git/vela-añadida
# And make a commit. # Y haz un compromiso.
COUNT=0 CONTAR=0
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
COUNT=$((COUNT+1)) CONTAR=$((CONTAR+1))
fi fi
done hecho
test "$COUNT" -ge 1 prueba "$COUNT" -ge 1
# Make a second commit that only records a single change. # Realizar una segunda confirmación que solo registre un único cambio.
COUNT=0 CONTAR=0
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
COUNT=$((COUNT+1)) CONTAR=$((CONTAR+1))
fi fi
done hecho
test "$COUNT" -ge 2 prueba "$COUNT" -ge 2
# And a third one. # Y un tercero.
COUNT=0 CONTAR=0
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
COUNT=$((COUNT+1)) CONTAR=$((CONTAR+1))
fi fi
done hecho
test "$COUNT" -ge 3 prueba "$COUNT" -ge 3

View file

@ -1,27 +1,27 @@
title = The command line título = La línea de comando
cards = tarjetas =
[description] [descripción]
These playing cards are designed to be easy to use and to remember! We'd suggest sticking to them if you don't have a lot of experience with Git! ¡Estos naipes están diseñados para ser fáciles de usar y recordar! ¡Te sugerimos que los sigas si no tienes mucha experiencia con Git!
[cli] [cli]
But there's another way to interact with Git: Pero hay otra forma de interactuar con Git:
Try typing `git init` into the black terminal below, and pressing the enter key! Intente escribir `git init` en la terminal negra a continuación y presione la tecla Intro.
[setup] [configuración]
rm -rf .git rm-rf.git
[win] [ganar]
# Initialize the time machine! # ¡Inicializa la máquina del tiempo!
test -d .git prueba -d .git
[congrats] [felicitaciones]
Cool! Instead of using the playing cards, you can also do everything via the command line! ¡Fresco! ¡En lugar de usar las cartas, también puedes hacer todo a través de la línea de comando!
The command line is pretty powerful! Often, you can use it to solve tasks faster compared to using a graphical interface. ¡La línea de comando es bastante poderosa! A menudo, puedes usarlo para resolver tareas más rápido en comparación con el uso de una interfaz gráfica.

View file

@ -1,33 +1,33 @@
title = Your first commit título = Tu primer compromiso
cards = commit-auto tarjetas = compromiso-automático
[description] [descripción]
You can use your time machine to make snapshots of objects around you! Here, let's practice this! ¡Puedes usar tu máquina del tiempo para tomar instantáneas de los objetos que te rodean! ¡Aquí, practiquemos esto!
(Your teacher pours some water into a glass.) (Tu maestra vierte un poco de agua en un vaso).
[cli] [cli]
Again, instead of using the card, you can also type the commands which are printed on it into the black terminal below! Nuevamente, en lugar de usar la tarjeta, ¡también puedes escribir los comandos que están impresos en ella en la terminal negra a continuación!
This is totally optional! But this will be a super useful skill in the real world - and it will give you a sparkling golden badge! :) ¡Esto es totalmente opcional! Pero esta será una habilidad súper útil en el mundo real, ¡y te dará una brillante insignia dorada! :)
[setup] [configuración]
echo "The glass is full of water." > glass echo "El vaso está lleno de agua". > vidrio
[win] [ganar]
# Make a snapshot of the glass (a "commit") # Hacer una instantánea del vaso (un "compromiso")
git rev-parse HEAD git rev-parse CABEZA
# Change the contents of the glass! # ¡Cambia el contenido del vaso!
! test "$(cat glass)" = "The glass is full of water." ! test "$(cat glass)" = "El vaso está lleno de agua."
# And make a second commit! # ¡Y haz un segundo compromiso!
git rev-parse HEAD^ && ! test "$(git show main:glass)" = "The glass is full of water." git rev-parse CABEZA^ &&! test "$(git show main:glass)" = "El vaso está lleno de agua".
[congrats] [felicitaciones]
Nice! You can try making some additional commits. When you feel comfortable, click on "Next Level". ¡Lindo! Puedes intentar realizar algunas confirmaciones adicionales. Cuando te sientas cómodo, haz clic en "Siguiente nivel".

View file

@ -1,42 +1,42 @@
title = Making backups título = Hacer copias de seguridad
cards = tarjetas =
[description] [descripción]
This time, you're making a lot of backup copies - you can look at them by clicking on them! Esta vez, estás haciendo muchas copias de seguridad; ¡puedes verlas haciendo clic en ellas!
[congrats] [felicitaciones]
Okay, this kind of works. Bien, este tipo de trabajos.
But you're a bit worried that you'll end up with hundreds of copies of this form, and it will be hard to keep track of all of them. Pero le preocupa un poco terminar con cientos de copias de este formulario y será difícil realizar un seguimiento de todas ellas.
And especially when working with other people, sending copies back and forth doesn't seem ideal. Y especialmente cuando se trabaja con otras personas, enviar copias de un lado a otro no parece lo ideal.
You can't wait to try these time machines! ¡No puedes esperar a probar estas máquinas del tiempo!
[setup] [configuración]
rm -rf .git rm-rf.git
echo "~ Why I want to learn Git ~ echo "~ Por qué quiero aprender Git ~
(I still need to write this.)" >> form.txt (Aún necesito escribir esto.)" >> form.txt
echo "~ Why I want to learn Git ~ echo "~ Por qué quiero aprender Git ~
- So that I can undo mistakes" >> form2.txt - Para poder deshacer errores" >> form2.txt
echo "~ Why I want to learn Git ~ echo "~ Por qué quiero aprender Git ~
- So that I can undo mistakes - Para poder deshacer errores
- To track my projects over time" >> form2_final.txt - Para realizar un seguimiento de mis proyectos a lo largo del tiempo" >> form2_final.txt
cp form2_final.txt form2_really_final.txt cp form2_final.txt form2_really_final.txt
[win] [ganar]
# Add another line to form2_really_final.txt! # ¡Agrega otra línea a form2_really_final.txt!
test "$(cat form2_really_final.txt | wc -l )" -ge 5 prueba "$(cat form2_really_final.txt | wc -l )" -ge 5

View file

@ -1,23 +1,23 @@
title = Enter the time machine title = Entra en la máquina del tiempo
cards = init tarjetas = inicio
[description] [descripción]
You've been accepted to time travel school! Yay! It's your first day! Your teacher explains: ¡Has sido aceptado en la escuela de viajes en el tiempo! ¡Hurra! ¡Es tu primer día! Tu profesor explica:
"To do anything with a time machine, you first need to initialize it!" "¡Para hacer cualquier cosa con una máquina del tiempo, primero debes inicializarla!"
Drag that blue card up to play it! ¡Arrastra esa carta azul hacia arriba para jugarla!
[setup] [configuración]
rm -rf .git rm-rf.git
[win] [ganar]
# Initialize the time machine! # ¡Inicializa la máquina del tiempo!
test -d .git prueba -d .git
[congrats] [felicitaciones]
Nice! See that little owl squirrel that appeared? It will be your companion, and always show you where you are in time! ¡Lindo! ¿Ves esa pequeña ardilla búho que apareció? ¡Será tu compañero y siempre te mostrará dónde estás en el tiempo!

View file

@ -1,52 +1,52 @@
title = Working together título = Trabajando juntos
cards = pull commit-auto push tarjetas = tirar compromiso-empuje automático
[description] [descripción]
Let's add your name to our list of students! ¡Agreguemos su nombre a nuestra lista de estudiantes!
I already have a second commit of it in my time machine - let's work together! Ya tengo una segunda confirmación en mi máquina del tiempo: ¡trabajemos juntos!
[cli] [cli]
To go back to old commands, you can press arrow up and down. That way, you don't have to type in long commands twice. Para volver a los comandos antiguos, puede presionar las flechas hacia arriba y hacia abajo. De esa manera, no tendrás que escribir comandos largos dos veces.
[congrats] [felicitaciones]
Welcome to time travel school! :) I'll see you for your first class tomorrow! ¡Bienvenidos a la escuela de viajes en el tiempo! :) ¡Te veré mañana en tu primera clase!
[setup] [configuración]
echo "~ List of current students ~" > students echo "~ Lista de estudiantes actuales ~" > estudiantes
git add . git agregar.
git commit -m "Initial version" git commit -m "Versión inicial"
git push -u teacher main git push -u profesor principal
git update-ref -d refs/remotes/teacher/main git update-ref -d refs/remotes/teacher/main
[setup teacher] [profesor de configuración]
git reset --hard main git reset --hard principal
echo " eco "
- Sam -sam
- Alex" >> students - Alex" >> estudiantes
git add . git agregar.
git commit -m "Added two students" git commit -m "Se agregaron dos estudiantes"
[win] [ganar]
# Get the second commit from your teacher using `git pull`. # Obtén el segundo compromiso de tu maestro usando `git pull`.
test "$(git log --oneline teacher/main | wc -l)" -ge 2 prueba "$(git log --oneline teacher/main | wc -l)" -ge 2
# Add your name to the list of students # Agrega tu nombre a la lista de estudiantes.
test "$(cat students |wc -l)" -ge 5 prueba "$(estudiantes de gato |wc -l)" -ge 5
# Commit your result. # Confirma tu resultado.
test "$(git show main:students |wc -l)" -ge 5 prueba "$(git show main:estudiantes |wc -l)" -ge 5
[win teacher] [ganar maestro]
# And use `git push` to send it to your teacher! # ¡Y usa `git push` para enviárselo a tu profesor!
test "$(git show main:students |wc -l)" -ge 5 prueba "$(git show main:estudiantes |wc -l)" -ge 5

View file

@ -1,42 +1,42 @@
title = Living dangerously título = Vivir peligrosamente
cards = tarjetas =
[description] [descripción]
So you have decided to apply for time travel school, to learn how to use this time machine called "Git"! ¡Así que has decidido postularte a la escuela de viajes en el tiempo para aprender a usar esta máquina del tiempo llamada "Git"!
How exciting! ¡Que interesante!
You're almost done with the paperwork! You just need to fill in one more reason why you want to learn Git. ¡Ya casi has terminado con el papeleo! Sólo necesitas completar una razón más por la que quieres aprender Git.
[congrats] [felicitaciones]
Suddenly, your cat jumps on the table, snatches away the form, and runs away! Oh no. All your hard work, gone! De repente, tu gato salta sobre la mesa, le arrebata el formulario y sale corriendo. Oh, no. ¡Todo tu arduo trabajo, desaparecido!
You clearly need a better solution. Claramente necesita una mejor solución.
(Click "Next Level" as soon as you're ready!) (¡Haga clic en "Siguiente nivel" tan pronto como esté listo!)
[setup] [configuración]
rm -rf .git rm-rf.git
echo "~ Why I want to learn Git ~ echo "~ Por qué quiero aprender Git ~
- So that I can undo mistakes - Para poder deshacer errores
- To track my projects over time" >> form.txt - Para realizar un seguimiento de mis proyectos a lo largo del tiempo" >> form.txt
[actions] [comportamiento]
test "$(cat form.txt | wc -l )" -ge 5 && echo "(Has been stolen by your cat.) test "$(cat form.txt | wc -l )" -ge 5 && echo "(Ha sido robado por tu gato).
" > form.txt " > formulario.txt
[win] [ganar]
# Add another line to form.txt! # ¡Agrega otra línea al formulario.txt!
test "$(cat form.txt | wc -l )" -ge 5 prueba "$(cat form.txt | wc -l )" -ge 5

View file

@ -1,6 +1,6 @@
risky arriesgado
copies copias
init en eso
cli cli
commit comprometerse
remote remoto

View file

@ -1,38 +1,38 @@
title = Welcome to time travel school! title = ¡Bienvenido a la escuela de viajes en el tiempo!
cards = config-name commit-auto checkout tarjetas = nombre de configuración confirmación-pago automático
[description] [descripción]
You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school! Todavía estás bastante confundido por todo lo que está pasando. ¡Al día siguiente, decides inscribirte en la escuela de viajes en el tiempo!
Your time travel teacher welcomes you: "Hello there! Wanna tell us your name?" Tu profesor de viajes en el tiempo te da la bienvenida: "¡Hola! ¿Quieres decirnos tu nombre?"
[setup] [configuración]
git config --global user.name "You" git config --global usuario.nombre "Tú"
echo "~ Why do you want to learn how to use time machines? ~ echo "~ ¿Por qué quieres aprender a usar máquinas del tiempo? ~
[ ] To make sure that my cat doesn't eat my homework. [ ] Para asegurarme de que mi gato no se coma mi tarea.
[ ] So I don't have to keep copies of all my essays. [] Así que no tengo que guardar copias de todos mis ensayos.
[ ] To collaborate with other time travel students. [] Colaborar con otros estudiantes de viajes en el tiempo.
[ ] Other, please specify:" > form [ ] Otro, por favor especifique:" > formulario
[actions] [comportamiento]
test "$(git config user.name)" != "You" && cat form | grep -v Signature && echo " prueba "$(git config user.name)" != "Tú" && forma de gato | grep -v Firma && eco "
Signature: $(git config user.name)" >> form Firma: $(git config user.name)" >> formulario
[win] [ganar]
# Introduce yourself. # Presentarte.
test "$(git config user.name)" != "You" prueba "$(git config user.name)" != "Tú"
# Fill out the enrollment form, and commit it! # ¡Rellene el formulario de inscripción y confíelo!
git show main:form | grep '\[[xX]\]' git show principal:formulario | grep '\[[xX]\]'
[congrats] [felicitaciones]
"We're so glad to have you! "¡Estamos muy contentos de tenerte!
Git can help you fix problems in the past! It allows you to collaborate with other students of time travel! It's really powerful, and it's really popular! I'll see you for your first lesson tomorrow!" ¡Git puede ayudarte a solucionar problemas del pasado! ¡Te permite colaborar con otros estudiantes de viajes en el tiempo! ¡Es realmente poderoso y muy popular! ¡Te veré mañana en tu primera lección!"

View file

@ -1,26 +1,26 @@
[description] [descripción]
For this prototype, we assume you have some experience with the command line. Here are some commands that will be useful: Para este prototipo, asumimos que tienes algo de experiencia con la línea de comando. Aquí hay algunos comandos que serán útiles:
- ls - es
- echo content > file - contenido de eco> archivo
- cat file - archivo de gato
- mkdir dir - directorio mkdir
Find the riddle in your current directory and put the answer into the file "answer"! ¡Encuentra el acertijo en tu directorio actual y coloca la respuesta en el archivo "respuesta"!
[congrats] [felicitaciones]
Omnomnom! ¡Om nom nom!
For technical reasons, you can't use `cd` in this prototype yet. But there won't be a lot of interaction with the file system anyways. :) Por razones técnicas, todavía no puedes usar `cd` en este prototipo. Pero de todos modos no habrá mucha interacción con el sistema de archivos. :)
[setup] [configuración]
mkdir riddle acertijo mkdir
echo "ppl p" > riddle/consonants echo "ppl p" > acertijo/consonantes
echo "ae ie" > riddle/vowels echo "ae ie" > acertijo/vocales
[win] [ganar]
cat answer | grep -i "apple \\?pie" respuesta del gato | grep -i "manzana \\?tarta"

View file

@ -1,38 +1,38 @@
[description] [descripci鏮]
At its core, Git is very simple. It stores "objects", which are basically files identified by an "identifier" (short: ID). En esencia, Git es muy simple. Almacena "objetos", que son b嫳icamente archivos identificados por un "identificador" (abreviado: ID).
There are four types of objects: blobs, trees, commits, and tags. The simplest type is a "blob", which is just a piece of text. Hay cuatro tipos de objetos: blobs, 嫫boles, confirmaciones y etiquetas. El tipo m嫳 simple es un "blob", que es simplemente un fragmento de texto.
Let's create some blobs! To do that, create a file with the desired content, and then use 。reemos algunas manchas! Para hacer eso, cree un archivo con el contenido deseado y luego use
git hash-object -w <file> git hash-object -w <archivo>
The flag -w means "write", and tells Git to actually write the new blob to the disk. La bandera -w significa "escribir" y le dice a Git que realmente escriba el nuevo blob en el disco.
Create three new blobs! 。rea tres nuevos blobs!
[congrats] [felicitaciones]
Tip: You can also use a command like this to create a blob in a single line: Consejo: Tambi幯 puedes usar un comando como este para crear un blob en una sola l璯ea:
echo "awesome content" | git hash-object -w --stdin echo "contenido incre燢le" | git hash-objeto -w --stdin
Did you already notice that you can drag and drop all objects? :) 璣a notaste que puedes arrastrar y soltar todos los objetos? :)
[setup] [configuraci鏮]
[setup goal] [objetivo de configuraci鏮]
echo "Hi" > file1 eco "Hola" > archivo1
echo "Ho" > file2 eco "Ho" > archivo2
echo "Hu" > file3 eco "Hu" > archivo3
git hash-object -w file1 git hash-objeto -w archivo1
git hash-object -w file2 git hash-objeto -w archivo2
git hash-object -w file3 git hash-objeto -w archivo3
[win] [ganar]
BLOB_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep blob | wc -l) BLOB_COUNT=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | grep blob | wc -l)
test "$BLOB_COUNT" -gt 2 prueba "$BLOB_COUNT" -gt 2

View file

@ -1,27 +1,27 @@
[description] [descripción]
There's a simple command to remove all objects that are not referenced by anything: Hay un comando simple para eliminar todos los objetos a los que nada hace referencia:
git prune git podar
Remove all blobs in this repository. Elimine todos los blobs de este repositorio.
[congrats] [felicitaciones]
Generally, `git prune` will be useful if you want to clean up some objects you made. Generalmente, `git prune` será útil si desea limpiar algunos objetos que creó.
Alternatively, you can also click the "Reload" button to restart a level. Alternativamente, también puedes hacer clic en el botón "Recargar" para reiniciar un nivel.
[setup] [configuración]
echo "My master password is a1b2c3d4e5" | git hash-object -w --stdin echo "Mi contraseña maestra es a1b2c3d4e5" | git hash-objeto -w --stdin
echo "This blob really should not exist" | git hash-object -w --stdin echo "Esta mancha realmente no debería existir" | git hash-objeto -w --stdin
echo "This is a virus" | git hash-object -w --stdin echo "Esto es un virus" | git hash-objeto -w --stdin
[setup goal] [objetivo de configuración]
[win] [ganar]
OBJECT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | wc -l) OBJECT_COUNT=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | wc -l)
test "$OBJECT_COUNT" -eq 0 prueba "$OBJECT_COUNT" -eq 0

View file

@ -1,37 +1,37 @@
[description] [descripción]
So a tree describes a directory structure at a specific point in time. Entonces, un árbol describe una estructura de directorios en un momento específico.
It would be nice if we could remember when that state existed, and who authored it, right? Sería bueno si pudiéramos recordar cuándo existió ese estado y quién fue su autor, ¿verdad?
Enter: commits. They are objects that point to a tree and contain some additional metadata. You can create a commit using Ingrese: confirma. Son objetos que apuntan a un árbol y contienen algunos metadatos adicionales. Puedes crear una confirmación usando
git commit-tree <tree> -m "Description of your commit" git commit-tree <árbol> -m "Descripción de tu compromiso"
Make a commit from the tree in this repository! ¡Haz un compromiso desde el árbol de este repositorio!
[setup] [configuración]
touch empty_file toque archivo_vacío
git add . git agregar.
git write-tree árbol de escritura de git
rm empty_file rm archivo_vacío
git update-index --remove empty_file git update-index --eliminar archivo_vacío
[setup goal] [objetivo de configuración]
touch empty_file toque archivo_vacío
git add . git agregar.
git write-tree árbol de escritura de git
rm empty_file rm archivo_vacío
git update-index --remove empty_file git update-index --eliminar archivo_vacío
git commit-tree 3185 -m 'Clever commit message' git commit-tree 3185 -m 'Mensaje de confirmación inteligente'
[win] [ganar]
COMMIT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | wc -l) COMMIT_COUNT=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | grep commit | wc -l)
test "$COMMIT_COUNT" -gt 0 prueba "$COMMIT_COUNT" -gt 0

View file

@ -1,31 +1,31 @@
[description] [descripción]
When using the commit-tree command, you can optionally specify a parent: Al utilizar el comando commit-tree, opcionalmente puedes especificar un padre:
git commit-tree <tree> -m "Description" -p <parent commit> git commit-tree <árbol> -m "Descripción" -p <compromiso principal>
Make a string of three commits! ¡Haz una serie de tres confirmaciones!
Hint: You'll need a tree object. What could be the easiest way to obtain one? Sugerencia: necesitarás un objeto de árbol. ¿Cuál podría ser la forma más sencilla de obtener uno?
[setup] [configuración]
[setup goal] [objetivo de configuración]
git write-tree árbol de escritura de git
FIRST_COMMIT=$(git commit-tree 4b82 -m 'First commit :O') FIRST_COMMIT=$(git commit-tree 4b82 -m 'Primera confirmación:O')
SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Second commit :D') SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Segundo compromiso :D')
THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Third commit \o/') THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Tercer compromiso \o/')
[win] [ganar]
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ") COMMITS=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do para COMMITIR en $COMMITS; hacer
echo a commit named $COMMIT hacer eco de una confirmación llamada $COMMIT
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; entonces
return 0 regresar 0
fi fi
done hecho
return 1 regresar 1

View file

@ -1,30 +1,30 @@
[description] [descripción]
A commit can have multiple parents! You can specify the -p option multiple times, like this: ¡Un compromiso puede tener varios padres! Puede especificar la opción -p varias veces, así:
git commit-tree <tree> -m "Description" -p <parent1> -p <parent2> git commit-tree <árbol> -m "Descripción" -p <padre1> -p <padre2>
Build a rhombus shape from commits, where two commits point to the same parent, and then a fourth commit points to both of them. Construya una forma de rombo a partir de confirmaciones, donde dos confirmaciones apunten al mismo padre y luego una cuarta confirmación apunte a ambas.
[setup] [configuración]
[setup goal] [objetivo de configuración]
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
SOUTH=$(git commit-tree $TREE -m "South") SUR=$(git commit-tree $TREE -m "Sur")
EAST=$(git commit-tree $TREE -m "East" -p $SOUTH) ESTE=$(git commit-tree $ÁRBOL -m "Este" -p $SUR)
WEST=$(git commit-tree $TREE -m "West" -p $SOUTH) OESTE=$(git commit-tree $ÁRBOL -m "Oeste" -p $SUR)
NORTH=$(git commit-tree $TREE -m "Nort" -p $EAST -p $WEST) NORTE=$(git commit-tree $ÁRBOL -m "Norte" -p $ESTE -p $OESTE)
[win] [ganar]
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ") COMMITS=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do para COMMITIR en $COMMITS; hacer
# My first parent's parents has to be the same as my second parent's parent. # Los padres de mi primer padre tienen que ser los mismos que los de mi segundo padre.
if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; entonces
return 0 regresar 0
fi fi
done hecho
return 1 regresar 1

View file

@ -1,37 +1,37 @@
[description] [descripción]
Blobs usually represent the content of a file. But on their own, they don't have any metadata, not even a name! Los blobs suelen representar el contenido de un archivo. Pero por sí solos no tienen metadatos, ¡ni siquiera un nombre!
Git has a very powerful concept to store metadata related to blobs: the index! It's a list that relates blobs to filenames and access permissions. Git tiene un concepto muy poderoso para almacenar metadatos relacionados con blobs: ¡el índice! Es una lista que relaciona los blobs con los nombres de archivos y los permisos de acceso.
The most convenient option to add an entry to the index is via an existing file: La opción más conveniente para agregar una entrada al índice es a través de un archivo existente:
echo "my content" > file echo "mi contenido" > archivo
git update-index --add file git update-index --agregar archivo
Add three entries to the index! For a bonus challenge: can you add a file that is inside of a directory, like "directory/file"? ¡Agregue tres entradas al índice! Para un desafío adicional: ¿puedes agregar un archivo que esté dentro de un directorio, como "directorio/archivo"?
[congrats] [felicitaciones]
There's another way to add an entry to the index directly: Hay otra forma de agregar una entrada al índice directamente:
git update-index --add --cacheinfo <mode>,<blobhash>,<name> git update-index --add --cacheinfo <modo>,<blobhash>,<nombre>
The first three numbers of the mode describe the type of the entry, "100" is a regular file. Los primeros tres números del modo describen el tipo de entrada, "100" es un archivo normal.
The second three number describe the permissions. Only "644" (non-executable) and "755" (executable) are supported. Los segundos tres números describen los permisos. Sólo se admiten "644" (no ejecutable) y "755" (ejecutable).
You can insert the hash of an object into the terminal by right-clicking on it! :) ¡Puedes insertar el hash de un objeto en la terminal haciendo clic derecho sobre él! :)
[setup] [configuración]
[setup goal] [objetivo de configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
[win] [ganar]
test "$(git ls-files | wc -l)" -ge 3 prueba "$(git ls-files | wc -l)" -ge 3

View file

@ -1,29 +1,29 @@
[description] [descripción]
To remove an entry from the index, use a command like this: Para eliminar una entrada del índice, use un comando como este:
git update-index --force-remove <file> git update-index --force-remove <archivo>
Remove all entries from the index! ¡Elimine todas las entradas del índice!
[setup] [configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
[setup goal] [objetivo de configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
git update-index --force-remove file1 git update-index --force-remove archivo1
git update-index --force-remove file2 git update-index --force-remove archivo2
git update-index --force-remove file3 git update-index --force-remove archivo3
[win] [ganar]
test "$(git ls-files | wc -l)" -eq 0 prueba "$(git ls-files | wc -l)" -eq 0

View file

@ -1,33 +1,33 @@
[description] [descripción]
Instead of removing an entry from the index and adding one with the same name, you can also directly update that entry! En lugar de eliminar una entrada del índice y agregar una con el mismo nombre, ¡también puedes actualizar esa entrada directamente!
Put the content you want in a file with a matching name, and then run Coloque el contenido que desee en un archivo con un nombre coincidente y luego ejecute
git update-index <file> git update-index <archivo>
This will create a new blob, and update the hash of the entry to that blob. Esto creará un nuevo blob y actualizará el hash de la entrada de ese blob.
Update an entry in the index! ¡Actualiza una entrada en el índice!
[setup] [configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
[setup goal] [objetivo de configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
echo "new content" > file1 echo "nuevo contenido" > archivo1
git update-index file1 archivo de índice de actualización de git1
[win] [ganar]
# This is not really a good test for the winning condition... # Esta no es realmente una buena prueba para determinar la condición ganadora...
test "$(git ls-files -s | git hash-object --stdin)" != "10c4b28623e7e44e09f5a596450a50ab7ac31fbe" -a "$(git ls-files | wc -l)" -eq 3 test "$(git ls-files -s | git hash-object --stdin)" != "10c4b28623e7e44e09f5a596450a50ab7ac31fbe" -a "$(git ls-files | wc -l)" -eq 3

View file

@ -1,41 +1,41 @@
[description] [descripción]
Delete all objects in this repository using git commands only! ¡Elimine todos los objetos en este repositorio usando solo comandos git!
Useful commands: Comandos útiles:
git prune git podar
git reflog expire git reflog expira
[setup] [configuración]
echo foo > foo eco foo > foo
BLOB=$(git hash-object -w foo) BLOB=$(git hash-objeto -w foo)
echo bar > bar barra de eco > barra
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo blabber >> bar eco parloteo >> barra
git commit -a -m "Second commit" git commit -a -m "Segundo compromiso"
git update-ref refs/important HEAD git update-ref refs/CABEZA importante
git update-ref refs/interesting "$BLOB" git update-ref refs/interesante "$BLOB"
[setup goal] [objetivo de configuración]
echo foo > foo eco foo > foo
BLOB=$(git hash-object -w foo) BLOB=$(git hash-objeto -w foo)
echo bar > bar barra de eco > barra
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo blabber >> bar eco parloteo >> barra
git commit -a -m "Second commit" git commit -a -m "Segundo compromiso"
git update-ref refs/important HEAD git update-ref refs/CABEZA importante
git update-ref refs/interesting "$BLOB" git update-ref refs/interesante "$BLOB"
TREE=$(git mktree) ÁRBOL=$(git mktree)
git read-tree $TREE git árbol de lectura $ÁRBOL
rm -rf .git/refs/* rm -rf .git/refs/*
rm -rf .git/objects/* rm -rf .git/objetos/*
[win] [ganar]
test "$(git cat-file --batch-check --batch-all-objects | wc -l)" -eq 0 prueba "$(git cat-file --batch-check --batch-all-objects | wc -l)" -eq 0

View file

@ -1,28 +1,28 @@
[description] [descripci鏮]
Create two trees pointing to the same blob! 。rea dos 嫫boles que apunten al mismo blob!
[setup] [configuraci鏮]
[setup goal] [objetivo de configuraci鏮]
BLOB=$(echo "I am precious" | git hash-object -w --stdin) BLOB=$(echo "Soy precioso" | git hash-object -w --stdin)
git update-index --add --cacheinfo 100644,$BLOB,a git update-index --add --cacheinfo 100644,$BLOB,a
git write-tree 嫫bol de escritura de git
git update-index --force-remove a git update-index --forzar-eliminar un
git update-index --add --cacheinfo 100644,$BLOB,b 璯dice de actualizaci鏮 de git --add --cacheinfo 100644,$BLOB,b
git write-tree 嫫bol de escritura de git
git update-index --force-remove b 璯dice de actualizaci鏮 de git --force-remove b
[win] [ganar]
TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") 糠BOLES=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | 嫫bol grep | cut -f1 -d" ")
ALL_TREE_CHILDREN=$(for TREE in $TREES; do ALL_TREE_CHILDREN=$(para 糠BOL en $糠BOLES; hacer
git cat-file -p $TREE | cut -f1 | cut -f3 -d" " git cat-file -p $糠BOL | cortar -f1 | cortar -f3 -d" "
done) hecho)
NUMBER_OF_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | wc -l) NUMBER_OF_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | wc -l)
UNIQUE_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | sort -u | wc -l) UNIQUE_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | ordenar -u | wc -l)
test "$NUMBER_OF_CHILDREN" -gt "$UNIQUE_CHILDREN" prueba "$NUMBER_OF_CHILDREN" -gt "$UNIQUE_CHILDREN"

View file

@ -1,34 +1,34 @@
[description] [descripción]
Construct a chain of three trees, which don't point to anything else. Construye una cadena de tres árboles, que no apunten a nada más.
This is hard! The `git mktree` command might be useful. ¡Esto es duro! El comando `git mktree` puede resultar útil.
[setup] [configuración]
[setup goal] [objetivo de configuración]
git mktree git mktree
TREE=$(echo -e "040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\tdir" | git mktree) ÁRBOL=$(echo -e "040000 árbol 4b825dc642cb6eb9a060e54bf8d69288fbee4904\tdir" | git mktree)
echo -e "040000 tree $TREE\tdir" | git mktree echo -e "040000 árbol $TREE\tdir" | git mktree
[win] [ganar]
TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") ÁRBOLES=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | árbol grep | cut -f1 -d" ")
for TREE in $TREES; do para ÁRBOL en $ÁRBOLES; hacer
if [ "$(git cat-file -p $TREE | wc -l)" -eq 1 ]; then if [ "$(git cat-file -p $ÁRBOL | wc -l)" -eq 1 ]; entonces
if [ "$(git cat-file -p $TREE | cut -f1 | grep tree | wc -l)" -eq 1 ]; then if [ "$(git cat-file -p $TREE | cut -f1 | grep tree | wc -l)" -eq 1 ]; entonces
# So the tree has exactly one child, and it is a tree! # Entonces el árbol tiene exactamente un hijo, ¡y es un árbol!
TREE2=$(git cat-file -p $TREE | cut -f1 | grep tree | cut -f3 -d" ") ÁRBOL2=$(git cat-file -p $ÁRBOL | cortar -f1 | árbol grep | cortar -f3 -d" ")
if [ "$(git cat-file -p $TREE2 | wc -l)" -eq 1 ]; then if [ "$(git cat-file -p $TREE2 | wc -l)" -eq 1 ]; entonces
if [ "$(git cat-file -p $TREE2 | cut -f1 | grep tree | wc -l)" -eq 1 ]; then if [ "$(git cat-file -p $TREE2 | cut -f1 | grep tree | wc -l)" -eq 1 ]; entonces
# Same for its child! \o/ # ¡Lo mismo para su hijo! \o/
return 0 regresar 0
fi fi
fi fi
fi fi
fi fi
done hecho
return 1 regresar 1

View file

@ -1,42 +1,42 @@
[description] [descripción]
Let's take a look at "refs" (short for "references")! Refs are not objects, but rather very simple *pointers* to objects! They can help you keep track of what's where. ¡Echemos un vistazo a las "refs" (abreviatura de "referencias")! ¡Las referencias no son objetos, sino *punteros* muy simples a objetos! Pueden ayudarle a realizar un seguimiento de qué está y dónde.
You can create or update a ref with Puede crear o actualizar una referencia con
git update-ref refs/<refname> <newvalue> git update-ref refs/<nombre de referencia> <nuevo valor>
Make sure to always start a ref's name with "refs/"! That's a convention that helps Git find all refs you create. If you forget the "refs/", you will not see the ref. ¡Asegúrate de comenzar siempre el nombre de un árbitro con "refs/"! Esa es una convención que ayuda a Git a encontrar todas las referencias que creas. Si olvida "refs/", no verá la referencia.
Create refs that point to all objects in this repository! ¡Crea referencias que apunten a todos los objetos en este repositorio!
[setup] [configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
[setup goal] [objetivo de configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/a $BLOB1 git actualización-ref refs/a $BLOB1
git update-ref refs/b $BLOB2 git actualización-ref refs/b $BLOB2
git update-ref refs/c $TREE git actualización-ref refs/c $ÁRBOL
git update-ref refs/d $COMMIT git actualización-ref refs/d $COMMIT
[win] [ganar]
OBJECTS=$(git cat-file --batch-check='%(objectname)' --batch-all-objects | sort) OBJETOS=$(git cat-file --batch-check='%(nombre de objeto)' --batch-all-objects | sort)
REF_TARGETS=$(git show-ref -s | sort | uniq) REF_TARGETS=$(git show-ref -s | ordenar | uniq)
test "$OBJECTS" = "$REF_TARGETS" prueba "$OBJECTS" = "$REF_TARGETS"

View file

@ -1,41 +1,41 @@
[description] [descripción]
You can point refs to a new location using the same command you use to create them: Puede señalar referencias a una nueva ubicación usando el mismo comando que usa para crearlas:
git update-ref refs/<refname> <object> git update-ref refs/<nombre de referencia> <objeto>
As an exercise, make all refs in this repository point to the tree object! Como ejercicio, ¡haga que todas las referencias en este repositorio apunten al objeto del árbol!
[setup] [configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/a "$BLOB1" git actualización-ref refs/a "$BLOB1"
git update-ref refs/b "$COMMIT" git update-ref refs/b "$COMMIT"
[setup goal] [objetivo de configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/a "$BLOB1" git actualización-ref refs/a "$BLOB1"
git update-ref refs/b "$COMMIT" git update-ref refs/b "$COMMIT"
for REF in $(git for-each-ref --format='%(refname)'); do para REF en $(git for-each-ref --format='%(refname)'); hacer
git update-ref "$REF" "$TREE" git update-ref "$REF" "$ÁRBOL"
done hecho
[win] [ganar]
test "$(git show-ref -s | sort -u)" = "c7863f72467ed8dd44f4b8ffdb8b57ca7d91dc9e" prueba "$(git show-ref -s | sort -u)" = "c7863f72467ed8dd44f4b8ffdb8b57ca7d91dc9e"

View file

@ -1,41 +1,41 @@
[description] [descripción]
And finally, to delete a ref, use Y finalmente, para eliminar una referencia, use
git update-ref -d refs/<refname> git update-ref -d refs/<nombre de referencia>
Delete all refs! :P (Well, except for HEAD. HEAD is special.) ¡Elimina todas las referencias! :P (Bueno, excepto HEAD. HEAD es especial).
[setup] [configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/best_blob_ever "$BLOB1" git update-ref refs/best_blob_ever "$BLOB1"
git update-ref refs/beautiful_commit "$COMMIT" git update-ref refs/beautiful_commit "$COMMIT"
[setup goal] [objetivo de configuración]
echo hello > hello eco hola > hola
echo world > world eco mundo > mundo
BLOB1=$(git hash-object -w hello) BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w world) BLOB2=$(git hash-object -w mundo)
git add . git agregar.
TREE=$(git write-tree) ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Initial commit") COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/best_blob_ever "$BLOB1" git update-ref refs/best_blob_ever "$BLOB1"
git update-ref refs/beautiful_commit "$COMMIT" git update-ref refs/beautiful_commit "$COMMIT"
for REF in $(git for-each-ref --format='%(refname)'); do para REF en $(git for-each-ref --format='%(refname)'); hacer
git update-ref -d "$REF" git actualización-ref -d "$REF"
done hecho
[win] [ganar]
test "$(git show-ref | wc -l)" -eq 0 prueba "$(git show-ref | wc -l)" -eq 0

View file

@ -1,18 +1,18 @@
welcome bienvenido
basics lo esencial
blob-create creación de blobs
blob-remove eliminar blobs
index-add agregar índice
index-remove eliminar índice
index-update actualización del índice
tree-create crear arbol
tree-read lectura de árbol
tree-nested anidado en los árboles
commit-create comprometerse-crear
commit-parents padres comprometidos
commit-rhombus compromiso-rombo
ref-create ref-crear
ref-move movimiento de referencia
ref-remove ref-eliminar
symref-create crear symref
symref-no-deref symref-no-deref

View file

@ -1,21 +1,21 @@
[description] [descripci鏮]
Instead of pointing directly to objects, refs can also point to other refs! ‧n lugar de apuntar directamente a objetos, las referencias tambi幯 pueden apuntar a otras referencias!
When that happens, they are called "symbolic refs". You can create or update a symbolic ref using Cuando eso sucede, se les llama "referencias simb鏊icas". Puede crear o actualizar una referencia simb鏊ica usando
git symbolic-ref <name> <ref> git simb鏊ico-ref <nombre> <ref>
Create a symbolic ref called "refs/rainbow"! 。rea una referencia simb鏊ica llamada "refs/rainbow"!
[setup] [configuraci鏮]
[setup goal] [objetivo de configuraci鏮]
BLOB=$(git hash-object -w --stdin) BLOB=$(git hash-object -w --stdin)
git update-ref refs/double "$BLOB" git update-ref refs/doble "$BLOB"
git symbolic-ref refs/rainbow refs/double git simb鏊ico-ref refs/arco甏is refs/doble
[win] [ganar]
git symbolic-ref refs/rainbow git simb鏊ico-ref refs/arco iris

View file

@ -1,46 +1,46 @@
[description] [descripción]
When you have a symbolic ref (a ref pointing at another ref), and you decide you want it to be a regular ref again (pointing to an object), you're in for some trouble! :) Cuando tienes una referencia simbólica (una referencia que apunta a otra referencia) y decides que quieres que vuelva a ser una referencia normal (que apunta a un objeto), ¡te espera un problema! :)
What happens when you try pointing the symbolic ref directly to the blob using `git update-ref`? ¿Qué sucede cuando intentas apuntar la referencia simbólica directamente al blob usando `git update-ref`?
Oops! Turns out that when you reference a symbolic ref, it acts as if you had specified the ref it points to. To de-symbolic-ize it, use the `--no-deref` option directly after `update-ref`! ¡Ups! Resulta que cuando haces referencia a una referencia simbólica, actúa como si hubieras especificado la referencia a la que apunta. Para eliminarlo simbólico, use la opción `--no-deref` directamente después de `update-ref`.
Weird, huh? Qué raro, ¿eh?
[congrats] [felicitaciones]
Whew, we've covered a lot of things: Blobs! The index! Trees! Commits! Refs! Vaya, hemos cubierto muchas cosas: ¡Blobs! ¡El índice! ¡Árboles! ¡Se compromete! ¡Árbitros!
You now know about almost everything about how Git repositories look like on the inside! We think that's pretty cool! :) ¡Ahora sabes casi todo sobre cómo se ven los repositorios de Git por dentro! ¡Creemos que es genial! :)
Everything else is just convention and high-level commands that make interacting with the objects more convenient. Todo lo demás son sólo convenciones y comandos de alto nivel que hacen que la interacción con los objetos sea más conveniente.
We haven't covered: No hemos cubierto:
- tag objects (they are the fourth object type - a bit like refs with a description and an author) - etiquetar objetos (son el cuarto tipo de objeto, un poco como referencias con una descripción y un autor)
- configuration (allows you to specify remote repositories, for example) - configuración (le permite especificar repositorios remotos, por ejemplo)
- working with local files (which is, uh, arguably pretty important :P) - trabajar con archivos locales (lo cual es, posiblemente, bastante importante :P)
Thanks for playing! You're welcome to check out the "puzzle" levels in the dropdown, some of them are more advanced! ¡Gracias por jugar! Eres bienvenido a ver los niveles de "rompecabezas" en el menú desplegable, ¡algunos de ellos son más avanzados!
[setup] [configuración]
BLOB1=$(echo delicious | git hash-object -w --stdin) BLOB1=$(echo delicioso | git hash-object -w --stdin)
BLOB2=$(echo very | git hash-object -w --stdin) BLOB2=$(echo muy | git hash-object -w --stdin)
git update-ref refs/curly "$BLOB1" git update-ref refs/curly "$BLOB1"
git symbolic-ref refs/fries refs/curly git simbólico-ref refs/fries refs/curly
[setup goal] [objetivo de configuración]
BLOB1=$(echo delicious | git hash-object -w --stdin) BLOB1=$(echo delicioso | git hash-object -w --stdin)
BLOB2=$(echo very | git hash-object -w --stdin) BLOB2=$(echo muy | git hash-object -w --stdin)
git update-ref refs/curly "$BLOB1" git update-ref refs/curly "$BLOB1"
git symbolic-ref refs/fries refs/curly git simbólico-ref refs/fries refs/curly
git update-ref --no-deref refs/fries "$BLOB2" git update-ref --no-deref refs/fries "$BLOB2"
[win] [ganar]
git symbolic-ref refs/fries && return 1 git simbólico-ref refs/fries && retorno 1
test "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6" prueba "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6"

View file

@ -1,35 +1,35 @@
[description] [descripción]
After carefully building the index we want, it would be nice to save a permanent snapshot of it, right? Después de crear cuidadosamente el índice que queremos, sería bueno guardar una instantánea permanente del mismo, ¿verdad?
This is what the second type of objects is for: trees! You can convert the index into a tree using Para eso está el segundo tipo de objetos: ¡árboles! Puede convertir el índice en un árbol usando
git write-tree árbol de escritura de git
Try it! :) ¡Intentalo! :)
[congrats] [felicitaciones]
Nice! ¡Lindo!
Can you make a different tree? Modify the index, then call `git write-tree` again! ¿Puedes hacer un árbol diferente? Modifique el índice y luego llame a `git write-tree` nuevamente.
[setup] [configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
[setup goal] [objetivo de configuración]
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
echo "file 3" > file3 eco "archivo 3" > archivo3
git add . git agregar.
git write-tree árbol de escritura de git
[win] [ganar]
git cat-file -p 21a638f28022064c1f1df20844278b494d197979 git cat-file -p 21a638f28022064c1f1df20844278b494d197979

View file

@ -1,38 +1,38 @@
[description] [descripción]
Trees can also point to other trees! This way, they can describe nested directory structures. ¡Los árboles también pueden señalar a otros árboles! De esta manera, pueden describir estructuras de directorios anidados.
When you add a file inside of a directory to the index, and then call `git write-tree`, it will create a nested tree for the directory, and attach the blob to it. Cuando agrega un archivo dentro de un directorio al índice y luego llama a `git write-tree`, creará un árbol anidado para el directorio y le adjuntará el blob.
To solve this level, build a little stick figure, as shown on the left - a tree that points to two blobs, as well to a tree that points to two blobs. Para resolver este nivel, construye una pequeña figura de palo, como se muestra a la izquierda: un árbol que apunta a dos manchas, así como un árbol que apunta a dos manchas.
[setup] [configuración]
[setup goal] [objetivo de configuración]
echo "I'm the left arm" > arm1 echo "Soy el brazo izquierdo" > arm1
echo "I'm the right arm" > arm2 echo "Soy el brazo derecho" > arm2
mkdir hip cadera mkdir
echo "I'm the left leg" > hip/leg1 echo "Soy la pierna izquierda" > cadera/pierna1
echo "I'm the right leg" > hip/leg2 echo "Soy la pierna derecha" > cadera/pierna2
git add . git agregar.
git write-tree árbol de escritura de git
[win] [ganar]
TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") ÁRBOLES=$(git cat-file --batch-check='%(nombre de objeto) %(tipo de objeto)' --batch-all-objects | árbol grep | cut -f1 -d" ")
for OUTER_TREE in $TREES; do para OUTER_TREE en $TREES; hacer
NUMBER_OF_BLOB_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep blob | wc -l) NUMBER_OF_BLOB_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep blob | wc -l)
NUMBER_OF_TREE_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep tree | wc -l) NUMBER_OF_TREE_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep árbol | wc -l)
if [ $NUMBER_OF_BLOB_CHILDREN -eq 2 -a $NUMBER_OF_TREE_CHILDREN -eq 1 ]; then si [ $NUMBER_OF_BLOB_CHILDREN -eq 2 -a $NUMBER_OF_TREE_CHILDREN -eq 1 ]; entonces
TREE_CHILD=$(git cat-file -p $OUTER_TREE | cut -f1 | grep tree | cut -d" " -f3) TREE_CHILD=$(git cat-file -p $OUTER_TREE | cortar -f1 | grep árbol | cortar -d" " -f3)
NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD=$(git cat-file -p $TREE_CHILD | cut -f2 -d" " | grep blob | wc -l) NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD=$(git cat-file -p $TREE_CHILD | cut -f2 -d" " | grep blob | wc -l)
if [ $NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD -eq 2 ]; then si [ $NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD -eq 2 ]; entonces
return 0 regresar 0
fi fi
fi fi
done hecho
return 1 regresar 1

View file

@ -1,51 +1,51 @@
[description] [descripción]
As soon as you have some tree objects, you can always read them and set the index exactly to their content! Unsurprisingly, the command is called ¡Tan pronto como tenga algunos objetos de árbol, siempre podrá leerlos y establecer el índice exactamente según su contenido! Como era de esperar, el comando se llama
git read-tree <tree> git lectura-árbol <árbol>
For <tree>, you can provide the hash of any tree object - you can right-click one to insert its hash into the terminal! Para <árbol>, puede proporcionar el hash de cualquier objeto de árbol; puede hacer clic derecho en uno para insertar su hash en la terminal.
Try reading some of the trees in this repository into the index! ¡Intenta leer algunos de los árboles de este repositorio en el índice!
[setup] [configuración]
EMPTY_TREE=$(git write-tree) EMPTY_TREE=$(git escribir-árbol)
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
git add . git agregar.
git write-tree árbol de escritura de git
rm * habitación *
echo "file A" > fileA echo "archivo A" > archivoA
echo "file B" > fileB echo "archivo B" > archivoB
echo "file C" > fileC echo "archivo C" > archivoC
git add . git agregar.
TRIPLE_TREE=$(git write-tree) TRIPLE_TREE=$(git escribir-árbol)
git read-tree "$EMPTY_TREE" git árbol de lectura "$EMPTY_TREE"
[setup goal] [objetivo de configuración]
EMPTY_TREE=$(git write-tree) EMPTY_TREE=$(git escribir-árbol)
echo "file 1" > file1 eco "archivo 1" > archivo1
echo "file 2" > file2 eco "archivo 2" > archivo2
git add . git agregar.
git write-tree árbol de escritura de git
rm * habitación *
echo "file A" > fileA echo "archivo A" > archivoA
echo "file B" > fileB echo "archivo B" > archivoB
echo "file C" > fileC echo "archivo C" > archivoC
git add . git agregar.
TRIPLE_TREE=$(git write-tree) TRIPLE_TREE=$(git escribir-árbol)
git read-tree "$EMPTY_TREE" git árbol de lectura "$EMPTY_TREE"
git read-tree "$TRIPLE_TREE" git árbol de lectura "$TRIPLE_TREE"
[win] [ganar]
test "$(git ls-files | wc -l)" -gt 0 prueba "$(git ls-files | wc -l)" -gt 0

View file

@ -1,33 +1,33 @@
[description] [descripción]
This is prototype #1 for the Git learning game by @bleeptrack and @blinry. Thanks for checking it out! <3 Este es el prototipo n.° 1 para el juego de aprendizaje Git de @bleeptrack y @blinry. Gracias por echarle un vistazo! <3
You can interact with the repository labelled "yours" by typing Bash commands in the terminal below! The visualization will show you its internal status. ¡Puedes interactuar con el repositorio etiquetado como "tuyo" escribiendo comandos Bash en la terminal a continuación! La visualización le mostrará su estado interno.
Let's get started by initializing an empty Git repository in the current directory by typing: Comencemos inicializando un repositorio Git vacío en el directorio actual escribiendo:
git init inicio de git
[congrats] [felicitaciones]
Well done! ¡Bien hecho!
An empty Git repository is... well, quite empty. The only thing that always exists is a reference called "HEAD" - we'll learn what that is later! Un repositorio Git vacío está... bueno, bastante vacío. Lo único que siempre existe es una referencia llamada "HEAD". ¡Aprenderemos qué es más adelante!
But first, let's look at some basics! Pero primero, ¡veamos algunos conceptos básicos!
(Click "Next Level" as soon as you're ready!) (¡Haga clic en "Siguiente nivel" tan pronto como esté listo!)
[setup] [configuración]
rm -rf .git rm-rf.git
[setup goal] [objetivo de configuración]
rm -rf .git rm-rf.git
git init inicio de git
[win] [ganar]
test -d .git prueba -d .git

View file

@ -1,47 +1,47 @@
title = Contradictions título = Contradicciones
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
Sometimes, timelines will contradict each other. A veces, los plazos se contradicen entre sí.
For example, in this case, one of our clients wants these timelines merged, but they ate different things for breakfast in both timelines. Por ejemplo, en este caso, uno de nuestros clientes quiere fusionar estas líneas de tiempo, pero desayunó cosas diferentes en ambas líneas de tiempo.
Try to merge them together! You'll notice that there will be a conflict! The time machine will leave it up to you how to proceed: you can edit the problematic item, it will show you the conflicting sections. You can keep either of the two versions - or create a combination of them! Remove the >>>, <<<, and === markers, and make a new commit to finalize the merge! ¡Intenta fusionarlos! ¡Notarás que habrá un conflicto! La máquina del tiempo dejará que usted elija cómo proceder: puede editar el elemento problemático, le mostrará las secciones en conflicto. Puedes conservar cualquiera de las dos versiones o crear una combinación de ellas. Elimine los marcadores >>>, <<< y === y realice una nueva confirmación para finalizar la fusión.
Let your finalized timeline be the "main" one. Deje que su cronograma finalizado sea el "principal".
[setup] [configuración]
echo "Just woke up. Is hungry." > sam echo "Acabo de despertar. Tiene hambre". > sam
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
git checkout -b pancakes git checkout -b panqueques
echo "Had blueberry pancakes with maple syrup for breakfast." > sam echo "Comí panqueques de arándanos con jarabe de arce para desayunar". > sam
git add . git agregar.
git commit -m "Pancakes!" git commit -m "¡Panqueques!"
echo " eco "
Is at work." >> sam Está en el trabajo." >> sam
git commit -am "Go to work" git commit -am "Ir a trabajar"
git checkout -b muesli main git checkout -b muesli principal
echo "Had muesli with oats and strawberries for breakfast." > sam echo "Comí muesli con avena y fresas para desayunar." > sam
git add . git agregar.
git commit -m "Muesli!" git commit -m "¡Muesli!"
echo " eco "
Is at work." >> sam Está en el trabajo." >> sam
git commit -am "Go to work" git commit -am "Ir a trabajar"
git checkout main git pago principal
[win] [ganar]
# Make a breakfast compromise in the 'main' branch. # Haga un compromiso para el desayuno en la rama 'principal'.
git rev-parse main^ && test "$(git rev-parse main^1^^)" = "$(git rev-parse main^2^^)" git rev-parse main^ && test "$(git rev-parse main^1^^)" = "$(git rev-parse main^2^^)"
[congrats] [felicitaciones]
Yum, that sounds like a good breakfast! ¡Mmm, eso suena como un buen desayuno!

View file

@ -1,82 +1,82 @@
title = Merging timelines título = Fusionar líneas de tiempo
cards = checkout commit-auto merge tarjetas = pago confirmación-fusión automática
[description] [descripción]
Here's a trick so that you can sleep a bit longer: just do all your morning activities in parallel universes, and then at the end, merge them together! Aquí tienes un truco para que puedas dormir un poco más: simplemente haz todas tus actividades matutinas en universos paralelos y, al final, ¡fúndelas!
[setup] [configuración]
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "The Beginning" git commit -m "El comienzo"
echo "You have a baguette. echo "Tienes una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy a baguette" git commit -m "Compras una baguette"
echo "You ate a baguette. echo "Te comiste una baguette.
You do not have coffee. No tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You eat the baguette" git commit -m "Te comes la baguette"
git checkout HEAD~2 git pago CABEZA~2
echo "You do not have a baguette. echo "No tienes baguette.
You have coffee. Tienes café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You buy some coffee" git commit -m "Compras un poco de café"
echo "You do not have a baguette. echo "No tienes baguette.
You drank coffee. Bebiste café.
You do not have a donut." > you No tienes donut." > tu
git add . git agregar.
git commit -m "You drink the coffee" git commit -m "Tú bebes el café"
git checkout HEAD~2 git pago CABEZA~2
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You have a donut." > you Tienes un donut." > tú
git add . git agregar.
git commit -m "You buy a donut" git commit -m "Compras una dona"
echo "You do not have a baguette. echo "No tienes baguette.
You do not have coffee. No tienes café.
You ate a donut." > you Te comiste un donut." > tú
git add . git agregar.
git commit -m "You eat the donut" git commit -m "Te comes el donut"
git checkout --detach git checkout --separar
git branch -D main rama git -D principal
[win] [ganar]
# Build a situation where you consumed a baguette, a coffee, *and* a donut. # Crea una situación en la que hayas consumido una barra de pan, un café y *y* un donut.
{ git show HEAD:you | grep "You ate.*baguette"; } && { git show HEAD:you | grep "You drank.*coffee"; } && { git show HEAD:you | grep "You ate.*donut"; } { git show HEAD:tú | grep "Comiste.*baguette"; } && { git show HEAD:tú | grep "Bebiste.*café"; } && { git show HEAD:tú | grep "Comiste.*dona"; }
# Be on a merge commit. # Estar en un compromiso de fusión.
test "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2 prueba "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2
[congrats] [felicitaciones]
I wonder if you're more relaxed when you *sleep* in parallel timelines... Me pregunto si estás más relajado cuando *duermes* en líneas de tiempo paralelas...

View file

@ -1,54 +1,54 @@
title = Abort a merge title = Cancelar una fusión
cards = checkout commit-auto merge merge-abort tarjetas = pago confirmar-fusión automática fusión-abortar
[description] [descripción]
Sometimes you want to merge two commits, but a merge conflict occurs that you currently don't want to resolve. A veces desea fusionar dos confirmaciones, pero se produce un conflicto de fusión que actualmente no desea resolver.
In these situations you can abort the merge to merge later. Use En estas situaciones, puede cancelar la fusión para fusionarla más tarde. Usar
git merge --abort git fusionar --abortar
when you are in a merge process. cuando estás en un proceso de fusión.
Try to merge both commits and abort the merge afterwards. Intente fusionar ambas confirmaciones y luego cancele la fusión.
[setup] [configuración]
echo "A new day is starting" > you echo "Un nuevo día está comenzando" > tú
git add . git agregar.
git commit -m "Start" git commit -m "Inicio"
echo "Walking down the Main Lane." >> you echo "Caminando por el carril principal". >> tu
git add . git agregar.
git commit -m "Main Lane" git commit -m "Carril principal"
git checkout HEAD~1 git pago CABEZA~1
echo "Walking down the Side Lane." >> you echo "Caminando por el carril lateral". >> tu
git add . git agregar.
git commit -m "Side Lane" git commit -m "Carril lateral"
git checkout HEAD~1 git pago CABEZA~1
git branch -D main rama git -D principal
[actions] [comportamiento]
if test -f .git/MERGE_HEAD; then si prueba -f .git/MERGE_HEAD; entonces
touch .git/secretfile toque .git/secretfile
fi fi
[win] [ganar]
# You tried to merge? # ¿Intentaste fusionarte?
test -f .git/secretfile prueba -f .git/archivosecreto
# You aborted to merge? # ¿Abortaste la fusión?
test -f .git/secretfile && ! test -f .git/MERGE_HEAD && ! git rev-parse HEAD^^ prueba -f .git/secretfile &&! prueba -f .git/MERGE_HEAD &&! git rev-parse CABEZA^^
[congrats] [felicitaciones]
Aaah, let's merge later... Aaah, fusionémonos más tarde...

View file

@ -1,2 +1,2 @@
merge unir
conflict conflicto

View file

@ -1,47 +1,47 @@
title = Friend título = Amigo
cards = pull push commit-auto checkout tarjetas = tirar empujar confirmar-pago automático
[description] [descripción]
Your friend added another line to your essay! Get it, add a third one and send it to them! ¡Tu amigo agregó otra línea a tu ensayo! ¡Consíguelo, agrega un tercero y envíaselo!
Take turns until you have five lines! ¡Túrnense hasta tener cinco líneas!
[setup yours] [configura el tuyo]
echo "Line 1" > essay echo "Línea 1" > ensayo
git add . git agregar.
git commit -m "One line" git commit -m "Una línea"
git push -u friend main git push -u amigo principal
[setup friend] [amigo de configuración]
git checkout main git pago principal
echo "Line 2, gnihihi" >> essay echo "Línea 2, gnihihi" >> ensayo
git commit -am "Another line" git commit -am "Otra línea"
[actions friend] [acciones amigo]
if test "$(git log --oneline | wc -l)" -eq 3; then si prueba "$(git log --oneline | wc -l)" -eq 3; entonces
git reset --hard main # Necessary because the working directory isn't updated when we push to the friend. git reset --hard main # Necesario porque el directorio de trabajo no se actualiza cuando enviamos al amigo.
echo "Line 4, blurbblubb" >> essay echo "Línea 4, Blubbblubb" >> ensayo
git commit -am "Final line" git commit -am "Línea final"
hint "Oh nice, I added a fourth line!" pista "¡Qué bien, agregué una cuarta línea!"
fi fi
[win] [ganar]
# Got the second line from your friend # Recibí la segunda línea de tu amigo.
git show HEAD:essay | grep gnihihi git show HEAD:ensayo | grep gnihihi
# Got the fourth line from your friend. # Recibí la cuarta línea de tu amigo.
git show HEAD:essay | grep blurbblubb git show HEAD:ensayo | grep blubbblubb
[win friend] [gana amigo]
# The friend got a third line from you # El amigo recibió una tercera línea tuya
test "$(git show HEAD:essay | wc -l)" -ge 3 prueba "$(git show HEAD:ensayo | wc -l)" -ge 3
# The friend got a fifth line from you # El amigo recibió una quinta línea tuya
test "$(git show HEAD:essay | wc -l)" -ge 5 prueba "$(git show HEAD:ensayo | wc -l)" -ge 5

View file

@ -1,33 +1,33 @@
title = Problems título = Problemas
cards = checkout add pull push commit-auto merge tarjetas = pagar agregar tirar empujar confirmar-fusión automática
[description] [descripción]
Both you and your friend have been working on the file, and want to sync up! ¡Tanto tú como tu amigo habéis estado trabajando en el archivo y queréis sincronizarlo!
[setup yours] [configura el tuyo]
echo "The bike shed should be ???" > file echo "¿El cobertizo para bicicletas debería ser ???" > archivo
git add . git agregar.
git commit -m "initial" git commit -m "inicial"
git push -u friend main git push -u amigo principal
echo "The bike shed should be green" > file echo "El cobertizo para bicicletas debe ser verde" > archivo
[setup friend] [amigo de configuración]
git checkout main git pago principal
echo "The bike shed should be blue" > file echo "El cobertizo para bicicletas debe ser azul" > archivo
git commit -a -m "friends version" git commit -a -m "versión de amigos"
[win] [ganar]
# Commit your local changes. # Confirme sus cambios locales.
test "$(git status -s)" = "" prueba "$(git status -s)" = ""
[win friend] [gana amigo]
# Look at your friend's suggestion, make a compromise, and push it back. # Mire la sugerencia de su amigo, haga un compromiso y retírelo.
git rev-parse main^ && test "$(git rev-parse main^1^)" = "$(git rev-parse main^2^)" git rev-parse main^ && test "$(git rev-parse main^1^)" = "$(git rev-parse main^2^)"

View file

@ -1,2 +1,2 @@
friend amigo
problems problemas

View file

@ -1,7 +1,7 @@
title = Empty sandbox título = Zona de pruebas vacía
[description] [descripción]
This is an empty sandbox you can play around in. Esta es una caja de arena vacía en la que puedes jugar.
[setup] [configuración]

View file

@ -1,22 +1,22 @@
title = Sandbox with a remote title = Sandbox con control remoto
cards = checkout commit-auto pull fetch push tarjetas = pago confirmar-auto tirar buscar empujar
[description] [descripción]
Here's a sandbox with a remote! Try pulling, fetching, or pushing! ¡Aquí tienes una caja de arena con control remoto! ¡Intenta tirar, buscar o empujar!
How can you push tags and branches on a remote? How can you delete them again? ¿Cómo se pueden insertar etiquetas y ramas en un control remoto? ¿Cómo puedes borrarlos nuevamente?
[setup yours] [configura el tuyo]
echo "Line 1" > essay echo "Línea 1" > ensayo
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
git push -u friend main git push -u amigo principal
[setup friend] [amigo de configuración]
git checkout main git pago principal
echo "Line 2" >> essay echo "Línea 2" >> ensayo
git commit -am "Another line" git commit -am "Otra línea"

View file

@ -1,3 +1,3 @@
empty vacío
remote remoto
three-commits tres compromisos

View file

@ -1,26 +1,26 @@
title = Sandbox with three commits título = Sandbox con tres confirmaciones
cards = checkout add reset-file checkout-file commit merge rebase tarjetas = pagar agregar restablecer-archivo pagar-archivo confirmar fusionar rebase
[setup] [configuración]
echo "You wake up." > you echo "Te despiertas". > tu
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
echo "You drink coffee." >> you echo "Bebes café". >> tu
git commit -am "First things first" git commit -am "Lo primero es lo primero"
echo "You hear a knock on the door." >> you echo "Escuchas un golpe en la puerta". >> tu
git commit -am "Who's there?" git commit -am "¿Quién está ahí?"
git branch not_main rama git not_main
[description] [descripción]
Here's a sandbox you can play around in. Aquí tienes una caja de arena en la que puedes jugar.
You can use both the playing cards, as well as the terminal. This is a real Git terminal! Fun things to try: Podrás utilizar tanto las cartas, como el terminal. ¡Esta es una verdadera terminal Git! Cosas divertidas para probar:
- Make a commit that merges three timelines together at once! - ¡Haz un compromiso que combine tres líneas de tiempo a la vez!
- Create and delete some tags! - ¡Crea y elimina algunas etiquetas!
- Make a timeline that's completely independent of the rest! - ¡Crea una línea de tiempo que sea completamente independiente del resto!

View file

@ -1,30 +1,30 @@
title = Undo a bad commit title = Deshacer una confirmación incorrecta
cards = reset commit-a tarjetas = restablecer compromiso-a
[description] [descripción]
Oh no, we made a bad commit! How can we undo making the commit, and go back to a point where we can try again? ¡Oh no, hicimos un mal compromiso! ¿Cómo podemos deshacer el compromiso y volver a un punto en el que podamos volver a intentarlo?
The answer is using `git reset [commit]`, which does two things: La respuesta es usar `git reset [commit]`, que hace dos cosas:
- It resets the current branch ref to the commit you specify. - Restablece la referencia de la rama actual a la confirmación que especifiques.
- And it resets the index to that commit. - Y restablece el índice de esa confirmación.
It does not change your working directory in any way, which means that after that, you can try making the commit you want again. No cambia su directorio de trabajo de ninguna manera, lo que significa que después de eso, puede intentar realizar la confirmación que desee nuevamente.
[setup] [configuración]
echo "1 2 3 4" > numbers eco "1 2 3 4" > números
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo "1 2 3 4 5 6 7 8 9 11" > numbers eco "1 2 3 4 5 6 7 8 9 11" > números
git commit -am "More numberrrrrs" git commit -am "Más númerosrrrrs"
[win] [ganar]
# In the last main commit, the numbers file contains the numbers from 1 to 10. # En la última confirmación principal, el archivo de números contiene los números del 1 al 10.
test "$(git show main:numbers)" = "1 2 3 4 5 6 7 8 9 10" prueba "$(git show main:números)" = "1 2 3 4 5 6 7 8 9 10"
# The commit message of that commit is "More numbers". # El mensaje de confirmación de esa confirmación es "Más números".
git log -1 --oneline | grep "More numbers" git log -1 --oneline | grep "Más números"
# The commit with the typo is not part of the main branch anymore. # La confirmación con el error tipográfico ya no forma parte de la rama principal.
git log --oneline | grep -v "rrrrr" registro de git --oneline | grep -v "rrrrr"

View file

@ -1,54 +1,54 @@
title = I pushed something broken título = Empujé algo roto
cards = revert push tarjetas = revertir el empujón
[description] [descripción]
We were talking about how to undo a commit, and fix it. This only helps when you haven't already pushed it to a remote. When that has happened, and you want to undo the effects of the commit completely, your best option is `git revert` Estábamos hablando de cómo deshacer una confirmación y solucionarla. Esto sólo ayuda cuando aún no lo has activado a un control remoto. Cuando eso haya sucedido y desee deshacer completamente los efectos de la confirmación, su mejor opción es `git revert`
[setup] [configuración]
echo "this is fine eco "esto está bien
? ?
? ?
?" > text ?" > texto
git add . git agregar.
git commit -m fine git commit -m bien
echo "this is fine eco "esto está bien
this is also fine esto también está bien
? ?
?" > text ?" > texto
git commit -am "also fine" git commit -estoy "también bien"
echo "this is fine eco "esto está bien
this is also fine esto también está bien
this is very bad esto es muy malo
?" > text ?" > texto
git commit -am "very bad" git commit -soy "muy malo"
echo "this is fine eco "esto está bien
this is also fine esto también está bien
this is very bad esto es muy malo
this is fine again" > text esto está bien otra vez" > texto
git commit -am "fine again" git commit -estoy "bien otra vez"
git push team main equipo principal de git push
git branch -u team/main main git rama -u equipo/principal principal
[setup team] [equipo de preparación]
[win team] [equipo ganador]
# The team's main branch no longer contains the bad thing. # La rama principal del equipo ya no contiene lo malo.
! { git show main:text | grep -q "very bad"; } ! { git show principal:texto | grep -q "muy malo"; }
# And the history has not been modified. # Y el historial no ha sido modificado.
git show main^:text | grep -q "very bad" git show principal^:texto | grep -q "muy malo"

View file

@ -1,26 +1,26 @@
title = Go back to where you were before title = Vuelve a donde estabas antes
cards = checkout reflog tarjetas = finalizar compra reflog
[description] [descripción]
Say you were looking at something in the past, and then switched back to the main branch. Supongamos que estaba mirando algo en el pasado y luego volvió a la rama principal.
But then, you got reaaally distracted, and after your lunch break, you can't remember on which commit in the past you were before. How can you find out? Pero luego, te distrajiste mucho y, después de la pausa para el almuerzo, no puedes recordar en qué compromiso del pasado estabas antes. ¿Cómo puedes saberlo?
There's a convenient command that shows you all the places your HEAD did point to in the past: Hay un comando conveniente que le muestra todos los lugares a los que su HEAD apuntó en el pasado:
git reflog git reflog
[setup] [configuración]
for i in {1..10}; do para i en {1..10}; hacer
git commit --allow-empty -m $i git confirmar --allow-empty -m $i
git branch $i rama git $i
done hecho
git checkout 3 git pago 3
git checkout main git pago principal
[win] [ganar]
# Find out where you've been before, and go back there! # ¡Descubre dónde has estado antes y regresa allí!
test "$(git rev-parse HEAD)" = "$(git rev-parse 3)" prueba "$(git rev-parse HEAD)" = "$(git rev-parse 3)"

View file

@ -1,22 +1,22 @@
title = Restore a deleted file title = Restaurar un archivo eliminado
cards = checkout tarjetas = pagar
[description] [descripción]
Oops - you deleted the "essay" file, which you worked on all night! ¡Vaya! Eliminaste el archivo de "ensayo", en el que trabajaste toda la noche.
Luckily, Git is here to help! You can use `git checkout` to restore the file! ¡Afortunadamente, Git está aquí para ayudar! ¡Puedes usar `git checkout` para restaurar el archivo!
[setup] [configuración]
echo important > essay eco importante > ensayo
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo "important content" > essay echo "contenido importante" > ensayo
git commit -am "Improve essay" git commit -am "Mejorar ensayo"
rm essay ensayo rm
[win] [ganar]
# Restore the essay to contain "important content" # Restaurar el ensayo para que contenga "contenido importante"
test "$(cat essay)" = "important content" test "$(cat essay)" = "contenido importante"

View file

@ -1,21 +1,21 @@
title = Restore a file from the past title = Restaurar un archivo del pasado
cards = checkout checkout-from commit tarjetas = pago pago-desde compromiso
[description] [descripción]
Here's a similar problem: you really liked the essay from the very first commit, and want to have it back! Well, checkout can also restore things from older commits, Here's how: Aquí hay un problema similar: ¡realmente te gustó el ensayo desde el primer compromiso y quieres recuperarlo! Bueno, el pago también puede restaurar cosas de confirmaciones anteriores. Aquí se explica cómo:
git checkout [commit] [file] git checkout [compromiso] [archivo]
[setup] [configuración]
echo "good version" > essay echo "buena versión" > ensayo
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo "bad version" > essay echo "mala versión" > ensayo
git commit -am "\"Improve\" essay" git commit -am "\"Mejorar\" ensayo"
[win] [ganar]
# Get the first version of your essay, and make a new commit with it. # Obtenga la primera versión de su ensayo y haga un nuevo compromiso con él.
test "$(git show main:essay)" = "good version" test "$(git show main:essay)" = "buena versión"

View file

@ -1,5 +1,5 @@
restore-a-file restaurar un archivo
restore-a-file-from-the-past restaurar-un-archivo-del-pasado
bad-commit mal compromiso
pushed-something-broken empujó-algo-roto
reflog volver a registrar

View file

@ -1,5 +1,5 @@
stash reserva
stash-pop alijo-pop
stash-clear alijo claro
stash-branch rama de alijo
stash-merge fusión de alijo

View file

@ -1,12 +1,12 @@
title = Stashing título = Escondite
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
You will encounter situations in which you are working on your project but you need to Te encontrarás con situaciones en las que estás trabajando en tu proyecto pero necesitas
put your current changes aside temporarily. To do so, you can use the stash function. Use deje a un lado sus cambios actuales temporalmente. Para hacerlo, puede utilizar la función de almacenamiento. Usar
git stash push git alijo empujar
to add your current changes to the stash stack. para agregar sus cambios actuales a la pila de almacenamiento.
--- ---
tipp1 tipp1
@ -15,31 +15,31 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "Apple Pie:" > recipe echo "Tarta de manzana:" > receta
git add . git agregar.
git commit -m "creating a recipe" git commit -m "creando una receta"
echo "- 4 Apples" >> recipe echo "- 4 manzanas" >> receta
git add . git agregar.
git commit -m "Adding ingredients" git commit -m "Agregar ingredientes"
echo "- 500g Flour" >> recipe echo "- 500g Harina" >> receta
git checkout main git pago principal
[win] [ganar]
# Did you stash the current changes? # ¿Escondiste los cambios actuales?
test "$(git stash list | wc -l)" -ge 1 prueba "$(git stash list | wc -l)" -ge 1
[actions] [comportamiento]
[congrats] [felicitaciones]
Nice stash you got there! :) ¡Qué buen alijo tienes ahí! :)

View file

@ -1,14 +1,14 @@
title = Branch from stash título = Rama del alijo
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
If you want to keep your changes but they don't belong to the main branch, you can easily Si desea conservar los cambios pero no pertenecen a la rama principal, puede hacerlo fácilmente
create a new branch from your stashed changes. Just use cree una nueva rama a partir de sus cambios guardados. Solo usa
git stash branch <branchname> <stash> git stash rama <nombre de rama> <alijo>
If you just want to use the latest stash entry, you can leave the <stash> option empty. Si solo desea utilizar la última entrada de alijo, puede dejar la opción <stash> vacía.
Create a new branch from the stashed changes! ¡Crea una nueva rama a partir de los cambios escondidos!
--- ---
tipp1 tipp1
@ -17,32 +17,32 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "Apple Pie:" > recipe echo "Tarta de manzana:" > receta
git add . git agregar.
git commit -m "creating a recipe" git commit -m "creando una receta"
echo "- 4 Apples" >> recipe echo "- 4 manzanas" >> receta
git add . git agregar.
git commit -m "Adding ingredients" git commit -m "Agregar ingredientes"
echo "- 500g Flour" >> recipe echo "- 500g Harina" >> receta
git stash push git alijo empujar
git checkout main git pago principal
[win] [ganar]
# Did you create a new branch from the stashed changes? # ¿Creaste una nueva rama a partir de los cambios ocultos?
test "$(git branch --list| wc -l)" -ge 2 prueba "$(git rama --list| wc -l)" -ge 2
[actions] [comportamiento]
[congrats] [felicitaciones]
Stashed changes are in a new branch! :) ¡Los cambios ocultos están en una nueva rama! :)

View file

@ -1,17 +1,17 @@
title = Clear the Stash título = Limpiar el alijo
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
If you want to inspect your stash stack, use the command Si desea inspeccionar su pila de alijo, use el comando
git stash list lista de alijo de git
Oh, you don't want to keep your stashed changes? There are way too many? Then go ahead and clear the stack with Oh, ¿no quieres conservar tus cambios escondidos? ¿Hay demasiados? Luego continúa y limpia la pila con
git stash clear git alijo claro
If you only want to discard a certain stash entry, you can use Si solo desea descartar una determinada entrada del alijo, puede utilizar
git stash drop <stash> git alijo soltar <alijo>
Clear your stash stack! ¡Limpia tu alijo!
--- ---
tipp1 tipp1
@ -20,38 +20,38 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "Apple Pie:" > recipe echo "Tarta de manzana:" > receta
git add . git agregar.
git commit -m "creating a recipe" git commit -m "creando una receta"
echo "- 4 Apples" >> recipe echo "- 4 manzanas" >> receta
git add . git agregar.
git commit -m "Adding ingredients" git commit -m "Agregar ingredientes"
echo "- 500g Flour" >> recipe echo "- 500g Harina" >> receta
git stash push git alijo empujar
echo "- 200g Sugar" >> recipe echo "- 200 g de azúcar" >> receta
git stash push git alijo empujar
echo "- Pinch of Salt" >> recipe echo "- Una pizca de sal" >> receta
git stash push git alijo empujar
git checkout main git pago principal
[win] [ganar]
# Did you clear your stash stack? # ¿Limpiaste tu pila de alijo?
test "$(git stash list | wc -l)" -eq 0 prueba "$(lista de alijo de git | wc -l)" -eq 0
[actions] [comportamiento]
[congrats] [felicitaciones]
All clear! :) ¡Todo claro! :)

View file

@ -1,13 +1,13 @@
title = Merging popped stash title = Fusionando alijo reventado
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
When you want to reapply your changes but you already continued working on your file, you might get Cuando desee volver a aplicar sus cambios pero ya continuó trabajando en su archivo, es posible que obtenga
a merge conflict! Let's practise this situation. ¡Un conflicto de fusión! Practiquemos esta situación.
Pop the changes from the stash with Explota los cambios del alijo con
git stash pop git alijo pop
and resolve the merge conflict. Commit the resolved changes and clear the stash stack afterwards. y resolver el conflicto de fusión. Confirme los cambios resueltos y borre la pila de alijo después.
--- ---
tipp1 tipp1
@ -16,39 +16,39 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "Apple Pie:" > recipe echo "Tarta de manzana:" > receta
git add . git agregar.
git commit -m "creating a recipe" git commit -m "creando una receta"
echo "- 4 Apples" >> recipe echo "- 4 manzanas" >> receta
git add . git agregar.
git commit -m "Adding ingredients" git commit -m "Agregar ingredientes"
echo "- 500g Flour" >> recipe echo "- 500g Harina" >> receta
git stash push git alijo empujar
echo "- Pinch of Salt" >> recipe echo "- Una pizca de sal" >> receta
git checkout main git pago principal
git add recipe git agregar receta
[win] [ganar]
# Did you resolve the conflict and commit? # ¿Resolviste el conflicto y te comprometiste?
{ git show HEAD | grep "Flour"; } && { git show HEAD | grep "Salt"; } {git show CABEZA | grep "Harina"; } && { git show CABEZA | grep "Sal"; }
# Did you clear stash stack? # ¿Limpiaste la pila de alijo?
test "$(git stash list | wc -l)" -eq 0 prueba "$(lista de alijo de git | wc -l)" -eq 0
[actions] [comportamiento]
[congrats] [felicitaciones]
Yay, you got your changes back! :) ¡Sí, recuperaste tus cambios! :)

View file

@ -1,12 +1,12 @@
title = Pop from Stash título = Pop de Stash
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
When you stashed your changes and you want to apply them back to your current working directory, you can use Cuando guardó sus cambios y desea volver a aplicarlos a su directorio de trabajo actual, puede usar
git stash pop git alijo pop
This will remove the changes from the stash stack. If you also want to keep the changes on the stash stack, use Esto eliminará los cambios de la pila de almacenamiento. Si también desea mantener los cambios en la pila de almacenamiento, utilice
git stash apply aplicar git stash
--- ---
tipp1 tipp1
@ -15,32 +15,32 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "Apple Pie:" > recipe echo "Tarta de manzana:" > receta
git add . git agregar.
git commit -m "creating a recipe" git commit -m "creando una receta"
echo "- 4 Apples" >> recipe echo "- 4 manzanas" >> receta
git add . git agregar.
git commit -m "Adding ingredients" git commit -m "Agregar ingredientes"
echo "- 500g Flour" >> recipe echo "- 500g Harina" >> receta
git stash push git alijo empujar
git checkout main git pago principal
[win] [ganar]
# Did you pop the changes from the stash stack? # ¿Sacaste los cambios de la pila de alijo?
test "$(git stash list | wc -l)" -eq 0 prueba "$(lista de alijo de git | wc -l)" -eq 0
[actions] [comportamiento]
[congrats] [felicitaciones]
Yay, you got your changes back! :) ¡Sí, recuperaste tus cambios! :)

View file

@ -1,17 +1,17 @@
title = Creating tags título = Creando etiquetas
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
Some of your commits may be special commits. Maybe you reached a milestone or a new version number. Algunas de sus confirmaciones pueden ser confirmaciones especiales. Quizás haya alcanzado un hito o un nuevo número de versión.
You can mark these commits with a special flag called 'tag'. Puede marcar estas confirmaciones con una bandera especial llamada "etiqueta".
Write Escribir
git tag <tag-name> etiqueta git <nombre-etiqueta>
to tag your commit. para etiquetar su compromiso.
--- ---
tipp1 tipp1
@ -20,34 +20,34 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "event 1" > feature-list echo "evento 1" > lista de características
git add . git agregar.
git commit -m "Adding feature 1" git commit -m "Agregar característica 1"
echo "event 2" >> feature-list echo "evento 2" >> lista de características
git add . git agregar.
git commit -m "Adding feature 2" git commit -m "Agregar característica 2"
echo "event 3" >> feature-list echo "evento 3" >> lista de características
git add . git agregar.
git commit -m "Adding feature 3" git commit -m "Agregar característica 3"
git checkout --detach main git checkout --separar principal
[win] [ganar]
# Did you create a new tag? # ¿Creaste una nueva etiqueta?
test "$(git tag -l | wc -l)" -ge 1 prueba "$(etiqueta git -l | wc -l)" -ge 1
[actions] [comportamiento]
[congrats] [felicitaciones]
Nice! You tagged your first commit :) ¡Lindo! Etiquetaste tu primer compromiso :)

View file

@ -1,14 +1,14 @@
title = Tagging later título = Etiquetar más tarde
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
But what happens if you forgot to tag your current commit? Pero, ¿qué sucede si olvidaste etiquetar tu compromiso actual?
No Prob! You can also tag older commits via ¡No hay problema! También puedes etiquetar confirmaciones más antiguas a través de
git tag <tag-name> <commit-hash> git tag <nombre-etiqueta> <hash-compromiso>
Tag the commit "Adding feature 2" with the name "v1"! ¡Etiquete la confirmación "Agregar función 2" con el nombre "v1"!
--- ---
tipp1 tipp1
@ -17,34 +17,34 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "event 1" > feature-list echo "evento 1" > lista de características
git add . git agregar.
git commit -m "Adding feature 1" git commit -m "Agregar característica 1"
echo "event 2" >> feature-list echo "evento 2" >> lista de características
git add . git agregar.
git commit -m "Adding feature 2" git commit -m "Agregar característica 2"
echo "event 3" >> feature-list echo "evento 3" >> lista de características
git add . git agregar.
git commit -m "Adding feature 3" git commit -m "Agregar característica 3"
git checkout --detach main git checkout --separar principal
[win] [ganar]
# Did you create a new tag? # ¿Creaste una nueva etiqueta?
test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)" test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)"
[actions] [comportamiento]
[congrats] [felicitaciones]
Well done :) Bien hecho :)

View file

@ -1,58 +1,58 @@
title = Remote Tags título = Etiquetas remotas
cards = pull push commit-auto checkout tarjetas = tirar empujar confirmar-pago automático
[description] [descripción]
When you work with remote repositories, tags are not pushed or pulled automatically. Cuando trabaja con repositorios remotos, las etiquetas no se insertan ni se extraen automáticamente.
You can push a tag with Puedes empujar una etiqueta con
git push <remote> <tag-name> git push <remoto> <nombre-etiqueta>
Or all tags with: O todas las etiquetas con:
git push <remote> --tags git push <remoto> --etiquetas
Deleting tags on your remote works with: La eliminación de etiquetas en su control remoto funciona con:
git push <remote> --delete <tag-name> git push <remoto> --delete <nombre-etiqueta>
You can also sync También puedes sincronizar
git fetch <remote> --prune --prune-tags git fetch <remoto> --prune --prune-tags
Add a tag named "v2" to the last commit and push it to the remote. Also pull the v1 tag to your local repository. Agregue una etiqueta llamada "v2" a la última confirmación y envíela al control remoto. También coloque la etiqueta v1 en su repositorio local.
[setup yours] [configura el tuyo]
git checkout main git pago principal
git checkout main git pago principal
echo "toothbrush sharing" > project-ideas echo "compartir cepillo de dientes" > ideas-proyecto
git add . git agregar.
git commit -m "First idea" git commit -m "Primera idea"
echo "Is my phone upside down? App" >> project-ideas echo "¿Está mi teléfono al revés? Aplicación" >> ideas de proyecto
git commit -am "Another idea" git commit -am "Otra idea"
git push friend main git push amigo principal
git branch -u friend/main main git rama -u amigo/principal principal
[setup friend] [amigo de configuración]
[actions friend] [acciones amigo]
git tag v1 HEAD~1 etiqueta git v1 CABEZA ~ 1
[win] [ganar]
# v1 tag in your repo # etiqueta v1 en tu repositorio
test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)" test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)"
# v2 tag in your repo # etiqueta v2 en tu repositorio
test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)" prueba "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"
[win friend] [gana amigo]
# v2 tag in the remote # etiqueta v2 en el control remoto
test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)" prueba "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"

View file

@ -1,13 +1,13 @@
title = Removing tags título = Eliminando etiquetas
cards = checkout commit-auto merge reset-hard tarjetas = pago confirmar-fusión automática restablecer-hard
[description] [descripción]
You added way too many tags? No prob! Delete them with ¿Agregaste demasiadas etiquetas? ¡No hay problema! eliminarlos con
git tag -d <tag-name> git tag -d <nombre-etiqueta>
Remove all tags in this repo! ¡Elimine todas las etiquetas de este repositorio!
--- ---
tipp1 tipp1
@ -16,38 +16,38 @@ tipp2
--- ---
tipp3 tipp3
[setup] [configuración]
echo "event 1" > feature-list echo "evento 1" > lista de características
git add . git agregar.
git commit -m "Adding feature 1" git commit -m "Agregar característica 1"
echo "event 2" >> feature-list echo "evento 2" >> lista de características
git add . git agregar.
git commit -m "Adding feature 2" git commit -m "Agregar característica 2"
echo "event 3" >> feature-list echo "evento 3" >> lista de características
git add . git agregar.
git commit -m "Adding feature 3" git commit -m "Agregar característica 3"
git tag v1 HEAD~2 etiqueta git v1 CABEZA ~ 2
git tag v2 HEAD~1 etiqueta git v2 CABEZA ~ 1
git tag v3 etiqueta git v3
git checkout --detach main git checkout --separar principal
[win] [ganar]
# Did you remove all tags? # ¿Eliminaste todas las etiquetas?
test "$(git tag -l | wc -l)" -eq 0 prueba "$(etiqueta git -l | wc -l)" -eq 0
[actions] [comportamiento]
[congrats] [felicitaciones]
Well done :) Bien hecho :)

View file

@ -1,4 +1,4 @@
add-tag añadir etiqueta
remove-tag Remover etiqueta
add-tag-later agregar etiqueta más tarde
remote-tag etiqueta remota

View file

@ -1,31 +1,31 @@
title = Getting the last version title = Obteniendo la última versión
cards = checkout-file tarjetas = archivo de pago
[description] [descripción]
You've been working on your essay for a while. But - ughh! Now your cat walks over your keyboard and "helps you", so now it's all messed up! :/ Has estado trabajando en tu ensayo por un tiempo. Pero... ¡uf! Ahora tu gato camina sobre tu teclado y "te ayuda", ¡así que ahora todo está arruinado! :/
But Git is here to help! To discard all changes your cat made, and go back to the version in the last commit, use `checkout`! ¡Pero Git está aquí para ayudar! Para descartar todos los cambios que hizo su gato y volver a la versión en la última confirmación, use `checkout`.
[setup] [configuración]
echo "A" >> essay.txt eco "A" >> ensayo.txt
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo "B" >> essay.txt eco "B" >> ensayo.txt
git commit -a -m "Improved version" git commit -a -m "Versión mejorada"
echo "C" >> essay.txt eco "C" >> ensayo.txt
git commit -a -m "Even better version" git commit -a -m "Versión aún mejor"
echo "D" >> essay.txt eco "D" >> ensayo.txt
git commit -a -m "Marvelous version" git commit -a -m "Versión maravillosa"
echo "blarg eco "blarg
blaaaargh" > essay.txt blaaaargh" > ensayo.txt
[win] [ganar]
# Restore the version from the last commit. # Restaurar la versión de la última confirmación.
cat essay.txt | grep D ensayo de gato.txt | grupo D

View file

@ -1,20 +1,20 @@
title = Cloning a repo título = Clonación de un repositorio
cards = clone commit-auto pull push cards = clonar compromiso-auto pull push
[description] [descripción]
Get your friend's repo using clone, change something, push it back. Obtenga el repositorio de su amigo usando clon, cambie algo, retírelo.
[setup] [configuración]
rm -rf .git rm-rf.git
[setup friend] [amigo de configuración]
echo hi > file eco hola > archivo
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
[win friend] [gana amigo]
test "$(git show main:file)" != hi prueba "$(git show main:file)" != hola

View file

@ -1,27 +1,27 @@
title = Make a commit \o/ título = Hacer una confirmación \o/
cards = add reset checkout commit tarjetas = agregar restablecer compromiso de pago
[description] [descripción]
For practice, make a commit where all files contain an "x"! Para practicar, haga una confirmación donde todos los archivos contengan una "x".
[setup] [configuración]
echo a > a eco a > a
echo x > b eco x > b
echo x > c eco x > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo x > a eco x > a
echo b > b eco b > b
git add b git agregar b
echo c > c eco c > c
[win] [ganar]
# File a contains "x" in the last main commit. # El archivo a contiene "x" en la última confirmación principal.
test "$(git show main:a)" = x prueba "$(git show main:a)" = x
# File b contains "x" in the last main commit. # El archivo b contiene "x" en la última confirmación principal.
test "$(git show main:b)" = x prueba "$(git show main:b)" = x
# File c contains "x" in the last main commit. # El archivo c contiene "x" en la última confirmación principal.
test "$(git show main:c)" = x prueba "$(git show main:c)" = x

View file

@ -1,26 +1,26 @@
title = Make a commit, but faster! title = ¡Haz un compromiso, pero más rápido!
cards = add reset checkout commit commit-a tarjetas = agregar restablecer pago confirmar compromiso-a
[description] [descripción]
There is a time-saving trick, where instead of a plain `git commit`, you can use Hay un truco para ahorrar tiempo, donde en lugar de un simple `git commit`, puedes usar
git commit -a git confirmar -a
This will automatically add all changes you made to local files! Very convenient. ¡Esto agregará automáticamente todos los cambios que realizó en los archivos locales! Muy conveniente.
[setup] [configuración]
echo a > a eco a > a
echo b > b eco b > b
echo c > c eco c > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo x > a eco x > a
echo x > b eco x > b
echo x > c eco x > c
[win] [ganar]
# Make a commit where all files contain "x". # Realizar una confirmación donde todos los archivos contengan "x".
test "$(git show main:a)" = x && test "$(git show main:b)" = x && test "$(git show main:c)" = x prueba "$(git show main:a)" = x && prueba "$(git show main:b)" = x && prueba "$(git show main:c)" = x

View file

@ -1,35 +1,35 @@
title = Fetching from remotes title = Obteniendo desde controles remotos
cards = checkout fetch commit-auto tarjetas = finalizar compra buscar compromiso-auto
[description] [descripción]
Here, you already have two remotes configured! You can list them using `git remote`. ¡Aquí ya tienes dos mandos configurados! Puede enumerarlos usando `git remoto`.
Fetch from both, and look at the suggestions. Obtenga de ambos y mire las sugerencias.
Then, make a new commit on top of your original one that introduces a compromise. Luego, haga un nuevo compromiso además del original que introduzca un compromiso.
[setup] [configuración]
echo "The bikeshed should be ???" > proposal echo "El cobertizo para bicicletas debería ser ???" > propuesta
git add . git agregar.
git commit -m "What do you think?" git commit -m "¿Qué piensas?"
[setup friend1] [configurar amigo1]
git pull yours main git tira el tuyo principal
echo "The bikeshed should be green" > proposal echo "El cobertizo para bicicletas debería ser verde" > propuesta
git commit -am "Green" git commit -soy "verde"
[setup friend2] [configurar amigo2]
git pull yours main git tira el tuyo principal
echo "The bikeshed should be blue" > proposal echo "El cobertizo para bicicletas debería ser azul" > propuesta
git commit -am "Blue" git commit -am "Azul"
[win] [ganar]
# Your proposal is acceptable for friend1. # Tu propuesta es aceptable para amigo1.
git show main:proposal | git grep green git show principal: propuesta | git grep verde
# Your proposal is acceptable for friend2. # Tu propuesta es aceptable para amigo2.
git show main:proposal | git grep blue git show principal: propuesta | git grep azul

View file

@ -1,27 +1,27 @@
title = No sleep required t癃ulo = No es necesario dormir
cards = file-new file-delete file-rename tarjetas = archivo-nuevo archivo-eliminar archivo-cambiar nombre
[description] [descripci鏮]
Actually, you decide that you don't need any sleep. En realidad, decides que no necesitas dormir.
Because of that, you won't require a bed, and can build some other piece of furniture from the wood! ·or eso no necesitar嫳 una cama y podr嫳 construir otro mueble con madera!
[setup] [configuraci鏮]
echo A yellow cupboard with lots of drawers. > cupboard echo Un armario amarillo con muchos cajones. > armario
echo A really big yellow shelf. > shelf echo Un estante amarillo muy grande. > estante
echo A comfortable, yellow bed with yellow cushions. > bed echo Una c鏔oda cama amarilla con cojines amarillos. > cama
[win] [ganar]
# Rename the bed into something else, and give it a new description! # 。ambia el nombre de la cama por otro y dale una nueva descripci鏮!
NUM_FILES="$(ls | wc -l)" NUM_FILES="$(ls | ba隳 -l)"
! test -f bed && test "$NUM_FILES" -ge 3 && ! grep -r "yellow bed" . ! prueba -f cama && prueba "$NUM_FILES" -ge 3 &&! grep -r "cama amarilla" .
[congrats] [felicitaciones]
Neat! It even still looks a bit comfortable! ‥impio! ncluso todav燰 parece un poco c鏔odo!
You head out, eager for your first lesson at time travel school! ﹖ales, ansioso por recibir tu primera lecci鏮 en la escuela de viajes en el tiempo!

View file

@ -1,26 +1,26 @@
title = Rename a file in the next commit title = Cambiar el nombre de un archivo en la próxima confirmación
cards = add reset-file checkout-file mv commit tarjetas = agregar archivo de reinicio archivo de pago mv commit
[description] [descripción]
Other times, you might want to rename a file in the next commit. Use Otras veces, es posible que desees cambiar el nombre de un archivo en la próxima confirmación. Usar
git mv [file] [new name] git mv [archivo] [nuevo nombre]
for that. The effect is very similar as if you had created a copy with a new name, and removed the old version. para eso. El efecto es muy similar a si hubiera creado una copia con un nombre nuevo y hubiera eliminado la versión anterior.
[setup] [configuración]
echo a > a eco a > a
echo SPECIAL > b eco ESPECIAL > b
echo x > c eco x > c
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo x > a eco x > a
echo b >> b eco b >> b
git add b git agregar b
[win] [ganar]
# Make a commit where you rename the file b to "x". # Realiza una confirmación donde cambias el nombre del archivo b a "x".
test "$(git ls-tree --name-only main)" = "$(echo -e "a\nc\nx")" test "$(git ls-tree --name-only main)" = "$(echo -e "a\nc\nx")"

View file

@ -1,14 +1,14 @@
title = Welcome! t癃ulo = 、ienvenido!
cards = init tarjetas = inicio
[description] [descripci鏮]
[setup] [configuraci鏮]
rm -rf .git rm-rf.git
[win] [ganar]
# Again, initialize your time machine! # ﹑uevamente, inicializa tu m嫭uina del tiempo!
test -d .git prueba -d .git

View file

@ -1,51 +1,51 @@
title = Helping each other título = Ayudándose unos a otros
cards = checkout commit-auto reset-hard pull push tarjetas = pago confirmar-reinicio automático-empuje duro
[description] [descripción]
The events and timelines you see are always only what your own time machine knows about! ¡Los eventos y líneas de tiempo que ves son siempre solo lo que tu propia máquina del tiempo conoce!
Of course, time agents don't have to work alone! Here, your sidekick has already prepared a merge for you! You can use the "pull" card to transfer it to your own time machine. ¡Por supuesto, los agentes de tiempo no tienen que trabajar solos! ¡Aquí, tu compañero ya ha preparado una fusión para ti! Puedes utilizar la tarjeta "pull" para transferirla a tu propia máquina del tiempo.
Then, add another event on top (what does Sam have for dinner?), and `push` the result, to transfer it back to your sidekick! Luego, agrega otro evento encima (¿qué cena Sam?) y "envía" el resultado para transferirlo de nuevo a tu compañero.
You can only ever manipulate things in your own time machine (the one on the bottom). Sólo puedes manipular cosas en tu propia máquina del tiempo (la que está en la parte inferior).
[setup yours] [configura el tuyo]
echo "Just woke up. Is hungry." > sam echo "Acabo de despertar. Tiene hambre". > sam
git add . git agregar.
git commit -m "The beginning" git commit -m "El comienzo"
git checkout -b pancakes git checkout -b panqueques
echo "Had blueberry pancakes with maple syrup for breakfast." > sam echo "Comí panqueques de arándanos con jarabe de arce para desayunar". > sam
git add . git agregar.
git commit -m "Pancakes!" git commit -m "¡Panqueques!"
git checkout -b muesli main git checkout -b muesli principal
echo "Had muesli with oats and strawberries for breakfast." > sam echo "Comí muesli con avena y fresas para desayunar." > sam
git add . git agregar.
git commit -m "Muesli!" git commit -m "¡Muesli!"
git checkout main git pago principal
git push -u sidekick main pancakes muesli git push -u compañero panqueques principales muesli
[setup sidekick] [compañero de configuración]
git checkout main git pago principal
git merge pancakes git fusionar panqueques
git merge muesli git fusionar muesli
echo "Had pancakes with strawberries for breakfast." > sam echo "Comí panqueques con fresas para desayunar". > sam
git add . git agregar.
git commit -m "Let's make this breakfast compromise" --author="Sidekick <sidekick@example.com>" git commit -m "Hagamos un compromiso con este desayuno" --author="Sidekick <sidekick@example.com>"
[win sidekick] [gana compañero]
# Below main's parent, there is a rhombus: # Debajo del padre principal, hay un rombo:
git rev-parse main^^ && test "$(git rev-parse main^^1^)" = "$(git rev-parse main^^2^)" git rev-parse main^^ && test "$(git rev-parse main^^1^)" = "$(git rev-parse main^^2^)"
[congrats] [felicitaciones]
In reality, in many cases, a lot of time agents work together to build a really good future together! :) En realidad, en muchos casos, ¡muchas veces los agentes trabajan juntos para construir juntos un futuro realmente bueno! :)

View file

@ -1,33 +1,33 @@
title = Adding a remote title = Agregar un control remoto
cards = checkout tarjetas = pagar
[description] [descripción]
Let's work together with others! Your friend has their own repo at the URL `../friend` - you can add it using ¡Trabajemos juntos con otros! Tu amigo tiene su propio repositorio en la URL `../friend`; puedes agregarlo usando
git remote add [name] [URL] git remoto agregar [nombre] [URL]
where `[name]` is an arbitrary, short name you pick for the remote. donde `[nombre]` es un nombre corto y arbitrario que usted elige para el control remoto.
When you've done that, you can get all commits from that remote using Cuando hayas hecho eso, podrás obtener todas las confirmaciones desde ese control remoto usando
git pull friend git pull amigo
There's a letter for you! ¡Hay una carta para ti!
[setup] [configuración]
git remote remove friend git remoto eliminar amigo
[setup friend] [amigo de configuración]
echo "I'm really committed to our friendship! <3" > love_letter echo "¡Estoy realmente comprometido con nuestra amistad! <3" > love_letter
git add . git agregar.
git commit -m "Write a letter" git commit -m "Escribe una carta"
[win] [ganar]
# Add a remote that points to ../friend. # Agrega un control remoto que apunte a ../friend.
git remote -v | grep '../friend' git remoto -v | grep '../amigo'
# Pull from the remote. # Tire del control remoto.
git show HEAD:love_letter | grep committed git show HEAD:love_letter | grep comprometido

View file

@ -1,23 +1,23 @@
title = Deleting and renaming a remote title = Eliminar y cambiar el nombre de un control remoto
cards = checkout tarjetas = pagar
[description] [descripción]
Here, you already have two remotes configured! You can list them using `git remote`. ¡Aquí ya tienes dos mandos configurados! Puede enumerarlos usando `git remoto`.
[setup] [configuración]
git remote rename friend frend git remoto cambiar el nombre amigo frend
[setup friend] [amigo de configuración]
[setup enemy] [preparar enemigo]
[win] [ganar]
# Rename the remote with the typo (using `git remote rename [old name] [new name]`) # Cambie el nombre del control remoto con el error tipográfico (usando `git remoto renombrar [nombre antiguo] [nombre nuevo]`)
git remote | grep friend git remoto | gran amigo
# The remote with the typo is gone. # El control remoto con el error tipográfico desapareció.
! grep 'frend' <(git remote) ! grep 'frend' <(git remoto)
# Delete the remote you don't want to keep (using `git remote remove [remote]`) # Elimina el control remoto que no deseas conservar (usando `git remoto remove [remoto]`)
! grep 'enemy' <(git remote) ! grep 'enemigo' <(git remoto)

View file

@ -1,28 +1,28 @@
title = Looking into the past título = Mirando hacia el pasado
cards = checkout-from tarjetas = pagar desde
[description] [descripción]
You've been working on your essay for a while. But you're not happy with the changes you've made recently. You want to go back to the version called "Best version"! Has estado trabajando en tu ensayo por un tiempo. Pero no está satisfecho con los cambios que ha realizado recientemente. ¡Quieres volver a la versión llamada "Mejor versión"!
No problem, you can use the `checkout` card to restore your essay from an older commit! No hay problema, puedes usar la tarjeta `checkout` para restaurar tu ensayo desde una confirmación anterior.
[setup] [configuración]
echo "Initial version" > essay.txt echo "Versión inicial" > ensayo.txt
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo "Improved version" > essay.txt echo "Versión mejorada" > ensayo.txt
git commit -a -m "Improved version" git commit -a -m "Versión mejorada"
echo "Best version" > essay.txt echo "Mejor versión" > ensayo.txt
git commit -a -m "Best version" git commit -a -m "Mejor versión"
echo "Less-good version" > essay.txt echo "Versión menos buena" > ensayo.txt
git commit -a -m "Less-good version" git commit -a -m "Versión menos buena"
[win] [ganar]
# For nostalgic reasons, restore the very first backup you made! # ¡Por razones nostálgicas, restaure la primera copia de seguridad que realizó!
diff essay.txt <(echo "Best version") diff ensayo.txt <(echo "Mejor versión")

View file

@ -1,26 +1,26 @@
title = Split a commit! title = ¡Dividir un compromiso!
cards = checkout commit reset-hard reset add rebase-interactive rebase-continue show tarjetas = pago confirmar reinicio-restablecimiento completo agregar rebase-interactivo rebase-continuar mostrar
[description] [descripción]
Here, both changes happened in one commit! Split them to be in two commits instead. ¡Aquí, ambos cambios ocurrieron en una sola confirmación! En su lugar, divídalos para que estén en dos confirmaciones.
[setup] [configuración]
echo something > file1 hacer eco de algo > archivo1
echo something else > file2 hacer eco de algo más > archivo2
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo this should happen first >> file1 echo esto debería suceder primero >> archivo1
echo and this should happen after that >> file2 echo y esto debería suceder después de eso >> archivo2
git commit -am "Both together" git commit -am "Ambos juntos"
echo this is some other change >> file1 echo este es algún otro cambio >> archivo1
echo this is some other change >> file2 echo este es algún otro cambio >> archivo2
git commit -am "Something else" git commit -am "Algo más"
[win] [ganar]
test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file2" && prueba "$(git diff-tree --no-commit-id --name-status -r main^)" = "M archivo2" &&
test "$(git diff-tree --no-commit-id --name-status -r main~2)" = "M file1" prueba "$(git diff-tree --no-commit-id --name-status -r main~2)" = "M archivo1"

View file

@ -1,23 +1,23 @@
title = One step after another título = Un paso tras otro
cards = checkout commit reset-hard add tarjetas = pago confirmar reinicio-adición completa
[description] [descripción]
Sometimes, you might want to record the order in which things changed, instead of making a single commit. A veces, es posible que desees registrar el orden en el que cambiaron las cosas, en lugar de realizar una única confirmación.
What happened here? Make two commits from the changes (using the "add" card), in an order that makes sense! ¿Que pasó aquí? Realice dos confirmaciones de los cambios (usando la tarjeta "agregar"), en un orden que tenga sentido.
[setup] [configuración]
echo something > file1 hacer eco de algo > archivo1
echo something else > file2 hacer eco de algo más > archivo2
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
echo this should happen first >> file1 echo esto debería suceder primero >> archivo1
echo and this should happen after that >> file2 echo y esto debería suceder después de eso >> archivo2
[win] [ganar]
test "$(git diff-tree --no-commit-id --name-status -r main)" = "M file2" && prueba "$(git diff-tree --no-commit-id --name-status -r main)" = "M archivo2" &&
test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file1" prueba "$(git diff-tree --no-commit-id --name-status -r main^)" = "M archivo1"

View file

@ -1,23 +1,23 @@
title = Nice to meet you! título = ¡Encantado de conocerte!
cards = config-name config-email tarjetas = nombre de configuración correo electrónico de configuración
[description] [descripción]
Introduce yourself using Preséntate usando
git config --global user.name Firstname git config --global usuario.nombre Nombre
git config --global user.email "your@mail.com" git config --global usuario.email "tu@correo.com"
[setup] [configuración]
[actions] [comportamiento]
test "$(git config user.name)" != "You" && hint "Hey $(git config user.name), nice to meet you!" test "$(git config user.name)" != "Tú" && sugerencia "Hola $(git config user.name), ¡encantado de conocerte!"
[win] [ganar]
# Have a name configured. # Tener un nombre configurado.
test "$(git config user.name)" != "You" prueba "$(git config user.name)" != "Tú"
# Have an email address configured. # Tener una dirección de correo electrónico configurada.
test "$(git config user.email)" != "you@time.agency" prueba "$(git config usuario.correo electrónico)" != "tú@time.agency"

View file

@ -1,18 +1,18 @@
title = Ignoring files título = Ignorar archivos
[description] [descripción]
That chicken is running around a lot, and changing often. We don't want to have it in our commits. Ese pollo corre mucho y cambia con frecuencia. No queremos tenerlo en nuestras confirmaciones.
Add it to the file .gitignore, and try using `git add .`! ¡Agréguelo al archivo .gitignore e intente usar `git add.`!
[setup] [configuración]
touch .gitignore toque .gitignore
echo important > important eco importante > importante
git add important git agregar importante
git commit -m "Initial commit" git commit -m "Compromiso inicial"
[actions] [comportamiento]
echo "$RANDOM" > chicken echo "$RANDOM" > pollo

View file

@ -1,26 +1,26 @@
title = Cloning a repo título = Clonación de un repositorio
cards = clone commit-auto reset-hard checkout file-new branch tarjetas = clonar confirmación-restablecimiento automático-archivo de pago completo-nueva rama
[description] [descripción]
Your friend has a problem! Clone the repo located in `../friend`, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`. ¡Tu amigo tiene un problema! Clona el repositorio ubicado en `../friend`, crea una rama llamada "solución" y soluciona el problema en esta rama. Cuando esté listo, haga una "Solicitud de extracción" usando `git tag pr`.
[setup] [configuración]
rm -rf .git rm-rf.git
[setup friend] [amigo de configuración]
echo "2 + 3 = " > file eco "2 + 3 = " > archivo
git add . git agregar.
git commit -m "Initial commit" git commit -m "Compromiso inicial"
[actions friend] [acciones amigo]
git ls-remote yours | grep pr && git fetch yours && git merge yours/solution git ls-remoto tuyo | grep pr && git busca el tuyo && git fusiona el tuyo/solución
git show main:file | grep 5 && hint "Thanks!" git show principal:archivo | grep 5 && sugerencia "¡Gracias!"
[win friend] [gana amigo]
git show main:file | grep 5 git show principal:archivo | grupo 5

View file

@ -1 +1 @@
pr pr

Some files were not shown because too many files have changed in this diff Show more