mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-04-29 16:53:55 +02:00
changes to make the game in spanish
This commit is contained in:
parent
9da0bd1fbd
commit
7c24e9b68e
101 changed files with 2073 additions and 2074 deletions
levels
bisect
branches
changing-the-past
files
index
intro
low-level
basicsblob-createblob-removecommit-createcommit-parentscommit-rhombusindex-addindex-removeindex-updatepuzzle-apocalypsepuzzle-precious-blobpuzzle-trees-all-the-way-downref-createref-moveref-removesequencesymref-createsymref-no-dereftree-createtree-nestedtree-readwelcome
merge
remotes
sandbox
shit-happens
stash
tags
unused
checkoutclonecommitcommit-afetchfiles-moveindex-mvinitpull-pushremotes-addremotes-deleterestoresplitstepswho-are-you
workflows
|
@ -1,43 +1,43 @@
|
|||
title = Yellow brick road
|
||||
cards = checkout commit-auto reset-hard bisect-start bisect-good bisect-bad
|
||||
título = Camino de ladrillos amarillos
|
||||
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
|
||||
if test $i -eq 12; then
|
||||
echo "Your pocket is empty." > you
|
||||
echo "Is on the ground." > key
|
||||
para i en {1..30}; hacer
|
||||
si prueba $i -eq 12; entonces
|
||||
echo "Tu bolsillo está vacío." > tu
|
||||
echo "Está en el suelo". > clave
|
||||
fi
|
||||
if test $i -eq 13; then
|
||||
echo "Is holding a key in its beak." > bird
|
||||
rm key
|
||||
si prueba $i -eq 13; entonces
|
||||
echo "Tiene una llave en el pico." > pájaro
|
||||
llave rm
|
||||
fi
|
||||
if test $i -eq 14; then
|
||||
rm bird
|
||||
si prueba $i -eq 14; entonces
|
||||
pájaro rm
|
||||
fi
|
||||
git add .
|
||||
git agregar.
|
||||
git commit --allow-empty -m "$i"
|
||||
done
|
||||
hecho
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Find the last good commit
|
||||
test "$(git log --pretty=%s main | head -1)" -eq 11
|
||||
# Encuentra el último compromiso bueno
|
||||
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...
|
|
@ -1 +1 @@
|
|||
bisect
|
||||
bisecar
|
|
@ -1,44 +1,44 @@
|
|||
title = Creating branches
|
||||
cards = checkout commit-auto branch branch-delete reset-hard
|
||||
título = Creando ramas
|
||||
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]
|
||||
|
||||
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
|
||||
git add .
|
||||
git commit -m "Evening preparations"
|
||||
echo "You go to the birthday party!" >> you
|
||||
git add .
|
||||
git commit -m "Go to the birthday"
|
||||
echo "Envuelves el regalo de cumpleaños y tomas tu entrada para el concierto". > tu
|
||||
git agregar.
|
||||
git commit -m "Preparativos de la tarde"
|
||||
echo "¡Vas a la fiesta de cumpleaños!" >> tu
|
||||
git agregar.
|
||||
git commit -m "Ir al cumpleaños"
|
||||
|
||||
git checkout HEAD~1
|
||||
echo "You go to the concert!" > you
|
||||
git add .
|
||||
git commit -m "Go to the concert"
|
||||
git pago CABEZA~1
|
||||
echo "¡Vas al concierto!" > tu
|
||||
git agregar.
|
||||
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.
|
||||
git show birthday | grep 'to the birthday'
|
||||
# Crea una rama llamada 'cumpleaños' que apunta a la línea de tiempo del cumpleaños.
|
||||
git mostrar cumpleaños | grep 'al cumpleaños'
|
||||
|
||||
# Create a branch called 'concert' that points to the concert timeline.
|
||||
git show concert | grep 'to the concert'
|
||||
# Crea una rama llamada 'concierto' que apunte a la línea de tiempo del concierto.
|
||||
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!
|
|
@ -1,47 +1,47 @@
|
|||
title = Deleting branches
|
||||
cards = checkout commit-auto reset-hard branch-delete
|
||||
título = Eliminando ramas
|
||||
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
|
||||
git add .
|
||||
git commit -m "Good morning!"
|
||||
echo Sales de tu casa y empiezas a caminar hacia la escuela. > tu
|
||||
git agregar.
|
||||
git commit -m "¡Buenos días!"
|
||||
|
||||
echo You walk on the right side of the street. >> you
|
||||
git commit -am "Right side"
|
||||
echo Caminas por el lado derecho de la calle. >> tu
|
||||
git commit -am "Lado derecho"
|
||||
|
||||
echo You jump over an manhole in the walkway, and arrive at school on time. >> you
|
||||
git commit -am "Jump"
|
||||
echo Saltas sobre una alcantarilla en la pasarela y llegas a la escuela a tiempo. >> tu
|
||||
git commit -am "Saltar"
|
||||
|
||||
git checkout HEAD^ -b friend
|
||||
echo Suddenly, you fall down, splash into stinking water, and are eaten by an alligator. >> you
|
||||
git commit -am "A new friend"
|
||||
git checkout HEAD^ -b amigo
|
||||
echo De repente, te caes, te sumerges en agua apestosa y eres devorado por un caimán. >> tu
|
||||
git commit -am "Un nuevo amigo"
|
||||
|
||||
git checkout HEAD~2 -b music
|
||||
echo You walk on the left side of the street. >> you
|
||||
git commit -am "Left side"
|
||||
git checkout HEAD~2 -b música
|
||||
echo Caminas por el lado izquierdo de la calle. >> tu
|
||||
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
|
||||
git commit -am "Sounds nice"
|
||||
echo Como llegas un poco tarde, empiezas a correr. Alguien arroja un piano por la ventana y te destroza. >> tu
|
||||
git commit -am "Suena bien"
|
||||
|
||||
git checkout HEAD^ -b ice-cream
|
||||
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
|
||||
git checkout HEAD^ -b helado
|
||||
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 branch -M main leap
|
||||
git checkout leap^^
|
||||
rama git -M salto principal
|
||||
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)"
|
||||
|
||||
[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? :)
|
|
@ -1,43 +1,43 @@
|
|||
title = Moving through time
|
||||
cards = checkout commit-auto
|
||||
título = Moviéndose a través del tiempo
|
||||
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]
|
||||
|
||||
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.
|
||||
It contains 10 coins." > piggy_bank
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "Esta alcancía pertenece a la hermana mayor.
|
||||
Contiene 10 monedas." > alcancía
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
echo "A young girl with brown, curly hair." > little_sister
|
||||
git add .
|
||||
git commit -m "Little sister comes in"
|
||||
echo "Una joven de cabello castaño y rizado". > hermanita_pequeña
|
||||
git agregar.
|
||||
git commit -m "Entra la hermana pequeña"
|
||||
|
||||
echo "Has 10 coins." >> little_sister
|
||||
echo "This piggy bank belongs to the big sister.
|
||||
It is empty." > piggy_bank
|
||||
git add .
|
||||
git commit -m "Little sister does something"
|
||||
echo "Tiene 10 monedas." >> hermanita_pequeña
|
||||
echo "Esta alcancía pertenece a la hermana mayor.
|
||||
Está vacío." > alcancía
|
||||
git agregar.
|
||||
git commit -m "La hermana pequeña hace algo"
|
||||
|
||||
git checkout HEAD^^
|
||||
git branch -df main
|
||||
git checkout CABEZA^^
|
||||
rama git -df principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Restore sisterly peace.
|
||||
{ git show HEAD:piggy_bank | grep "10 coins"; } && { git show HEAD:little_sister | grep -v "10 coins"; } && { git rev-parse HEAD^^^; }
|
||||
# Restaurar la paz fraternal.
|
||||
{ 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...
|
|
@ -1,65 +1,65 @@
|
|||
title = Make parallel commits
|
||||
cards = checkout commit-auto
|
||||
title = Realizar confirmaciones paralelas
|
||||
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]
|
||||
|
||||
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
|
||||
echo "Looks very hungry." > cage/lion
|
||||
jaula mkdir
|
||||
echo "Parece tener mucha hambre." > jaula/león
|
||||
|
||||
echo "A small child.
|
||||
It really loves cats!" > child
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "Un niño pequeño.
|
||||
¡Le encantan los gatos!" > niño
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
echo "It's holding a lollipop." >> child
|
||||
git commit -am "The child buys something"
|
||||
echo "Está sosteniendo una paleta". >> niño
|
||||
git commit -am "El niño compra algo"
|
||||
|
||||
mv child cage
|
||||
git add .
|
||||
git commit -m "The child climbs somewhere"
|
||||
jaula infantil mv
|
||||
git agregar.
|
||||
git commit -m "El niño sube a alguna parte"
|
||||
|
||||
git rm cage/child
|
||||
echo "Looks happy. :)" > cage/lion
|
||||
git add .
|
||||
git commit -m "Oh no"
|
||||
git rm jaula/niño
|
||||
echo "Parece feliz. :)" > jaula/león
|
||||
git agregar.
|
||||
git commit -m "Oh, no"
|
||||
|
||||
echo "It's sleeping." > cage/lion
|
||||
git add .
|
||||
git commit -m "Nap time!"
|
||||
echo "Está durmiendo". > jaula/león
|
||||
git agregar.
|
||||
git commit -m "¡Hora de la siesta!"
|
||||
|
||||
git checkout --detach
|
||||
git branch -d main
|
||||
git checkout --separar
|
||||
git rama -d principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make sure that the child is happy.
|
||||
git ls-tree --name-only -r HEAD | grep child
|
||||
# Asegúrese de que el niño esté feliz.
|
||||
git ls-tree --name-only -r HEAD | niño grep
|
||||
|
||||
# Make sure that the lion gets something to eat.
|
||||
git show HEAD:cage/lion | grep -v "very hungry"
|
||||
# Asegúrate de que el león tenga algo de comer.
|
||||
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...
|
|
@ -1,49 +1,49 @@
|
|||
title = Branches grow with you!
|
||||
cards = checkout commit-auto branch branch-delete reset-hard
|
||||
title = ¡Las ramas crecen contigo!
|
||||
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]
|
||||
|
||||
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
|
||||
git add .
|
||||
git commit -m "Evening preparations"
|
||||
echo "You go to the birthday party!" >> you
|
||||
git add .
|
||||
git commit -m "Go to the birthday"
|
||||
git branch birthday
|
||||
echo "Envuelves el regalo de cumpleaños y tomas tu entrada para el concierto". > tu
|
||||
git agregar.
|
||||
git commit -m "Preparativos de la tarde"
|
||||
echo "¡Vas a la fiesta de cumpleaños!" >> tu
|
||||
git agregar.
|
||||
git commit -m "Ir al cumpleaños"
|
||||
cumpleaños de la rama git
|
||||
|
||||
git checkout HEAD~1
|
||||
echo "You go to the concert!" > you
|
||||
git add .
|
||||
git commit -m "Go to the concert"
|
||||
git branch concert
|
||||
git pago CABEZA~1
|
||||
echo "¡Vas al concierto!" > tu
|
||||
git agregar.
|
||||
git commit -m "Ir al concierto"
|
||||
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
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test $(git rev-parse $commit^) = $(git rev-parse birthday); then
|
||||
return 0
|
||||
# Viaja directamente al último compromiso amarillo de la línea de tiempo del cumpleaños, haz un cambio a "tú" y realiza un compromiso
|
||||
para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
|
||||
si prueba $(git rev-parse $commit^) = $(git rev-parse cumpleaños); entonces
|
||||
regresar 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
hecho
|
||||
regresar 1
|
||||
|
||||
# Travel to the blue 'concert' branch, make a change to 'you', and a commit.
|
||||
git show concert^ | grep "Go to the concert"
|
||||
# Viaja a la rama azul 'concierto', haz un cambio en 'tú' y confirma.
|
||||
concierto de espectáculo de git ^ | grep "Ir al concierto"
|
|
@ -1,89 +1,89 @@
|
|||
title = Moving branches around
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
title = Moviendo ramas alrededor
|
||||
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 commit -m "The Beginning"
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
git checkout -b coffee
|
||||
echo "You have a baguette.
|
||||
git pago -b café
|
||||
echo "Tienes una baguette.
|
||||
|
||||
You do not have coffee.
|
||||
No tienes café.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You eat the baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Te comes la baguette"
|
||||
|
||||
git checkout -b baguette main
|
||||
echo "You do not have a baguette.
|
||||
git checkout -b baguette principal
|
||||
echo "No tienes baguette.
|
||||
|
||||
You have coffee.
|
||||
Tienes café.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy some coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You drink the coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Tú bebes el café"
|
||||
|
||||
git checkout -b donut main
|
||||
echo "You do not have a baguette.
|
||||
git checkout -b donut principal
|
||||
echo "No tienes baguette.
|
||||
|
||||
You do not have coffee.
|
||||
No tienes café.
|
||||
|
||||
You have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a donut"
|
||||
Tienes un donut." > tú
|
||||
git agregar.
|
||||
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?
|
||||
git show baguette:you | grep "You ate.*baguette"
|
||||
# ¿Te comiste una baguette en la rama de baguette?
|
||||
git show baguette:tú | grep "Comiste.*baguette"
|
||||
|
||||
# Did you drink a coffee on the coffee branch?
|
||||
git show coffee:you | grep "You drank.*coffee"
|
||||
# ¿Tomaste un café en la rama del café?
|
||||
git show café:tú | grep "Bebiste.*café"
|
||||
|
||||
# Did you eat a donut on the donut branch?
|
||||
git show donut:you | grep "You ate.*donut"
|
||||
# ¿Te comiste una rosquilla en la rama de rosquilla?
|
||||
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".
|
|
@ -1,6 +1,6 @@
|
|||
checkout-commit
|
||||
fork
|
||||
branch-create
|
||||
grow
|
||||
branch-remove
|
||||
reorder
|
||||
compromiso de pago
|
||||
tenedor
|
||||
crear rama
|
||||
crecer
|
||||
eliminar rama
|
||||
reordenar
|
|
@ -1,86 +1,86 @@
|
|||
title = Rebasing
|
||||
cards = checkout commit-auto reset-hard rebase
|
||||
título = 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 commit -m "The Beginning"
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
git checkout -b baguette main
|
||||
echo "You have a baguette.
|
||||
git checkout -b baguette principal
|
||||
echo "Tienes una baguette.
|
||||
|
||||
You do not have coffee.
|
||||
No tienes café.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You eat the baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Te comes la baguette"
|
||||
|
||||
git checkout -b coffee main
|
||||
echo "You do not have a baguette.
|
||||
git checkout -b café principal
|
||||
echo "No tienes baguette.
|
||||
|
||||
You have coffee.
|
||||
Tienes café.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy some coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You drink the coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Tú bebes el café"
|
||||
|
||||
git checkout -b donut main
|
||||
echo "You do not have a baguette.
|
||||
git checkout -b donut principal
|
||||
echo "No tienes baguette.
|
||||
|
||||
You do not have coffee.
|
||||
No tienes café.
|
||||
|
||||
You have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a donut"
|
||||
Tienes un donut." > tú
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You eat the donut"
|
||||
Te comiste un donut." > tú
|
||||
git agregar.
|
||||
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
|
||||
{ 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; }
|
||||
# Ordena todas las ramas de los árboles en una y mueve la rama principal ref.
|
||||
{ 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.
|
|
@ -1,78 +1,78 @@
|
|||
title = Reordering events
|
||||
cards = checkout commit-auto reset-hard rebase-interactive cherry-pick
|
||||
título = Reordenar eventos
|
||||
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
|
||||
git add .
|
||||
NO estás usando zapatos." > tú
|
||||
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
|
||||
git commit -am "Put on shoes"
|
||||
Estás usando zapatos." > tú
|
||||
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
|
||||
git commit -am "Put on pants"
|
||||
Estás usando zapatos." > tú
|
||||
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
|
||||
git commit -am "Put on underwear"
|
||||
Estás usando zapatos." > tú
|
||||
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
|
||||
git commit -am "Put on shirt"
|
||||
Estás usando zapatos." > tú
|
||||
git commit -am "Ponte la camisa"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Reorder the commits to dress yourself in the correct way
|
||||
{ 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; }
|
||||
# Reordena los commits para vestirte de la forma correcta
|
||||
{ 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?
|
|
@ -1,2 +1,2 @@
|
|||
rebase
|
||||
reorder
|
||||
reorder
|
|
@ -1,32 +1,32 @@
|
|||
title = Interior design
|
||||
cards = file-new file-delete
|
||||
título = Diseño de interiores
|
||||
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,
|
||||
you see that their colors match the color of your bed!
|
||||
Ahora que tu habitación luce ordenada, puedes comenzar a desempacar tus cosas. Trajiste dos muebles nuevos y con una sonrisa brillante,
|
||||
¡Ya ves que sus colores combinan con el color de tu cama!
|
||||
|
||||
Build up your two pieces of furniture by playing the touch card.
|
||||
Then name your furniture - you can choose whatever you like.
|
||||
Construye tus dos muebles jugando la carta táctil.
|
||||
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.
|
||||
Don't forget to add a color and description to your new furnitures, too!
|
||||
¡Asegúrate de que los colores combinen! Puedes encontrar el color de la cama en su descripción.
|
||||
¡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
|
||||
NUM_FILES="$(ls | wc -l)"
|
||||
test "$NUM_FILES" -ge 3
|
||||
# Agrega dos muebles más
|
||||
NUM_FILES="$(ls | baño -l)"
|
||||
prueba "$NUM_FILES" -ge 3
|
||||
|
||||
# Make sure the colors match your bed's color.
|
||||
NUM_FILES="$(ls | wc -l)"
|
||||
YELLOW_FILES="$(grep -li yellow * | wc -l)"
|
||||
test "$NUM_FILES" -ge 2 && test "$YELLOW_FILES" = "$NUM_FILES"
|
||||
# Asegúrese de que los colores coincidan con el color de su cama.
|
||||
NUM_FILES="$(ls | baño -l)"
|
||||
YELLOW_FILES="$(grep -li amarillo * | wc -l)"
|
||||
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?
|
|
@ -1,36 +1,36 @@
|
|||
title = Unexpected Roommates
|
||||
cards = file-delete
|
||||
título = Compañeros de cuarto inesperados
|
||||
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.
|
||||
Full of excitement you open the door just to find... spider webs! Spider webs everywhere!
|
||||
El primer día en Time Travel School llega a su fin y recibes la llave de tu habitación.
|
||||
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]
|
||||
|
||||
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 A big spider web sticks above your bed. > big_web
|
||||
echo A cozy bed. > bed
|
||||
echo An extra thick spider web is right beside your door. > thick_web
|
||||
echo Una pequeña telaraña está al lado de tu ventana. > pequeña_web
|
||||
echo Una gran telaraña cuelga encima de tu cama. > gran_web
|
||||
eco Una cama acogedora. > cama
|
||||
echo Una telaraña extra gruesa está justo al lado de tu puerta. > red_gruesa
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Remove all spider webs.
|
||||
! ls | grep thick_web &&
|
||||
# Retire todas las telas de araña.
|
||||
! ls | grep web_gruesa &&
|
||||
! ls | grep big_web &&
|
||||
! ls | grep tiny_web
|
||||
|
||||
# But make sure you keep your bed!
|
||||
ls | grep bed
|
||||
# ¡Pero asegúrate de quedarte en tu cama!
|
||||
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!
|
|
@ -1,3 +1,2 @@
|
|||
files-delete
|
||||
files-add
|
||||
|
||||
eliminar archivos
|
||||
agregar archivos
|
|
@ -1,38 +1,38 @@
|
|||
title = Updating files in the index
|
||||
cards = add commit checkout
|
||||
title = Actualizando archivos en el índice
|
||||
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
|
||||
echo b > b
|
||||
echo c > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
eco a > a
|
||||
eco b > b
|
||||
eco c > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make changes to all files!
|
||||
test "$(cat a)" != "a" &&
|
||||
test "$(cat b)" != "b" &&
|
||||
test "$(cat c)" != "c"
|
||||
# ¡Haz cambios en todos los archivos!
|
||||
prueba "$(cat a)" != "a" &&
|
||||
prueba "$(cat b)" != "b" &&
|
||||
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" &&
|
||||
test "$(git show main:b)" != "b" &&
|
||||
test "$(git show main:c)" != "c" &&
|
||||
test "$(git show main^:a)" != "a" &&
|
||||
test "$(git show main^:b)" == "b" &&
|
||||
test "$(git show main^:c)" != "c"
|
||||
prueba "$(git show main:a)" != "a" &&
|
||||
prueba "$(git show main:b)" != "b" &&
|
||||
prueba "$(git show main:c)" != "c" &&
|
||||
prueba "$(git show main^:a)" != "a" &&
|
||||
prueba "$(git show main^:b)" == "b" &&
|
||||
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!
|
|
@ -1,31 +1,31 @@
|
|||
title = Update files in the index
|
||||
cards = add commit
|
||||
title = Actualizar archivos en el índice
|
||||
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
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "La vela arde con una llama azul". > vela
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make a change to the candle.
|
||||
test "$(git diff --name-only)" = "candle" || file -f .git/candle-changed && touch .git/candle-changed
|
||||
# Haz un cambio en la vela.
|
||||
prueba "$(git diff --name-only)" = "vela" || archivo -f .git/vela-cambiada && toque .git/vela-cambiada
|
||||
|
||||
# Add the candle.
|
||||
test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added
|
||||
# Agrega la vela.
|
||||
prueba "$(git diff --cached --name-only)" = "vela" || archivo -f .git/vela-añadida && toque .git/vela-añadida
|
||||
|
||||
# Make a commit.
|
||||
test "$(git diff --name-only HEAD HEAD^)" = "candle"
|
||||
# Haz un compromiso.
|
||||
prueba "$(git diff --name-only HEAD HEAD^)" = "vela"
|
|
@ -1,25 +1,25 @@
|
|||
title = Checking out files from the index
|
||||
cards = add reset-file checkout-file commit
|
||||
title = Extraer archivos del índice
|
||||
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
|
||||
echo b > b
|
||||
echo c > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo x > b
|
||||
echo x > c
|
||||
git add c
|
||||
eco a > a
|
||||
eco b > b
|
||||
eco c > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco x > a
|
||||
eco x > b
|
||||
eco x > c
|
||||
git agregar c
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Remove all changes in your local files!
|
||||
test "$(git diff --name-only | wc -l)" -eq 0
|
||||
# ¡Elimina todos los cambios en tus archivos locales!
|
||||
prueba "$(git diff --name-only | wc -l)" -eq 0
|
|
@ -1,51 +1,51 @@
|
|||
title = Step by step
|
||||
cards = checkout commit-auto
|
||||
título = Paso a paso
|
||||
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!
|
||||
git branch --show-current | grep step-by-step
|
||||
# ¡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!
|
||||
rama git --show-current | grep paso a paso
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "A small, but heavy glass ball." > ball
|
||||
echo "A thin book, that's standing upright." > book
|
||||
echo "A candle, burning with a blue flame." > candle
|
||||
echo "A smoke detector. It's absolutely silent." > smoke_detector
|
||||
echo "Una bola de cristal pequeña pero pesada". > pelota
|
||||
echo "Un libro delgado, que está de pie". > libro
|
||||
echo "Una vela ardiendo con una llama azul". > vela
|
||||
echo "Un detector de humo. Es absolutamente silencioso." > detector_de_humo
|
||||
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
git agregar.
|
||||
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 "The book has fallen over." > book
|
||||
echo "The candle has been blown out." > candle
|
||||
echo "La pelota ahora toca el libro". > pelota
|
||||
echo "El libro se ha caído." > libro
|
||||
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
|
||||
git commit -am "The ball rolls towards the book"
|
||||
echo "La pelota ahora toca el libro". > pelota
|
||||
git commit -am "La pelota rueda hacia el libro"
|
||||
|
||||
echo "The book has fallen over." > book
|
||||
git commit -am "The book falls over"
|
||||
echo "El libro se ha caído." > libro
|
||||
git commit -am "El libro se cae"
|
||||
|
||||
echo "The candle has been blown out." > candle
|
||||
git commit -am "The book blows out the candle"
|
||||
echo "La vela se ha apagado". > vela
|
||||
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!
|
||||
git show step-by-step:smoke_detector | tail -n 1 | grep -v "absolutely silent"
|
||||
# ¡Elija la línea de tiempo que sea más clara y haga sonar la alarma!
|
||||
git muestra paso a paso: detector_de_humo | cola -n 1 | grep -v "absolutamente silencioso"
|
|
@ -1,28 +1,28 @@
|
|||
title = Add new files to the index
|
||||
cards = add commit
|
||||
title = Agregar nuevos archivos al índice
|
||||
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]
|
||||
|
||||
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.
|
||||
test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added
|
||||
# Agrega la vela.
|
||||
prueba "$(git diff --cached --name-only)" = "vela" || archivo -f .git/vela-añadida && toque .git/vela-añadida
|
||||
|
||||
# Make a commit.
|
||||
test "$(git ls-tree --name-only HEAD)" = "candle"
|
||||
# Haz un compromiso.
|
||||
prueba "$(git ls-tree --name-only HEAD)" = "vela"
|
|
@ -1,37 +1,37 @@
|
|||
title = Resetting files in the index
|
||||
cards = add reset-file commit
|
||||
title = Restablecer archivos en el índice
|
||||
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 "It's burning!" > green_candle
|
||||
echo "It's burning!" > blue_candle
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "¡Está ardiendo!" > vela_roja
|
||||
echo "¡Está ardiendo!" > vela_verde
|
||||
echo "¡Está ardiendo!" > vela_azul
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
echo "It's been blown out." > red_candle
|
||||
echo "It's been blown out." > green_candle
|
||||
echo "It's been blown out." > blue_candle
|
||||
git add .
|
||||
echo "Se ha apagado". > vela_roja
|
||||
echo "Se ha apagado". > vela_verde
|
||||
echo "Se ha apagado". > vela_azul
|
||||
git agregar.
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Reset the changes in the green and blue candles!
|
||||
git show :green_candle | grep burning &&
|
||||
git show :blue_candle | grep burning &&
|
||||
git show :red_candle | grep -v burning
|
||||
# ¡Restablece los cambios en las velas verdes y azules!
|
||||
espectáculo de git: green_candle | grep quemando &&
|
||||
espectáculo de git: blue_candle | grep quemando &&
|
||||
espectáculo de git: red_candle | grep -v quemando
|
||||
|
||||
# And make a commit!
|
||||
git show main:green_candle | grep burning &&
|
||||
git show main:blue_candle | grep burning &&
|
||||
git show main:red_candle | grep -v burning
|
||||
# ¡Y haz un compromiso!
|
||||
git show principal:green_candle | grep quemando &&
|
||||
git show principal:blue_candle | grep quemando &&
|
||||
git show principal:red_candle | grep -v quemando
|
|
@ -1,24 +1,24 @@
|
|||
title = Delete a file in the next commit
|
||||
cards = add reset-file checkout-file rm file-delete commit
|
||||
title = Eliminar un archivo en la próxima confirmación
|
||||
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
|
||||
echo x > b
|
||||
echo x > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo b > b
|
||||
git add b
|
||||
eco a > a
|
||||
eco x > b
|
||||
eco x > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco x > a
|
||||
eco b > b
|
||||
git agregar b
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make a commit where all files are deleted ¯\_(^_^)_/¯
|
||||
test "$(git ls-tree main | wc -l)" -eq 0
|
||||
# Realizar una confirmación donde se eliminan todos los archivos ¯\_(^_^)_/¯
|
||||
prueba "$(git ls-tree main | wc -l)" -eq 0
|
|
@ -1,5 +1,5 @@
|
|||
compare
|
||||
new
|
||||
change
|
||||
reset
|
||||
steps
|
||||
comparar
|
||||
nuevo
|
||||
cambiar
|
||||
reiniciar
|
||||
pasos
|
|
@ -1,53 +1,53 @@
|
|||
title = Adding changes step by step
|
||||
cards = add reset-file commit
|
||||
title = Agregar cambios paso a paso
|
||||
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 "A bottle, containing a clear liquid." > bottle
|
||||
echo "A white sugar cube." > sugar_cube
|
||||
echo "Un martillo, balanceándose sobre su mango". > martillo
|
||||
echo "Una botella que contiene un líquido transparente". > botella
|
||||
echo "Un terrón de azúcar blanco". > cubo_de_azúcar
|
||||
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make changes to all three objects, to form a logical sequence of events!
|
||||
test "$(git diff --name-only | wc -l)" -eq 3 || file -f .git/candle-changed && touch .git/candle-changed
|
||||
# ¡Realice cambios en los tres objetos para formar una secuencia lógica de eventos!
|
||||
prueba "$(git diff --name-only | wc -l)" -eq 3 || archivo -f .git/vela-cambiada && toque .git/vela-cambiada
|
||||
|
||||
# Only add one of these changes!
|
||||
test "$(git diff --cached --name-only | wc -l)" -eq 1 || file -f .git/candle-added && touch .git/candle-added
|
||||
# ¡Agregue solo uno de estos cambios!
|
||||
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.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
# Y haz un compromiso.
|
||||
CONTAR=0
|
||||
para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
|
||||
si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
|
||||
CONTAR=$((CONTAR+1))
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
test "$COUNT" -ge 1
|
||||
prueba "$COUNT" -ge 1
|
||||
|
||||
# Make a second commit that only records a single change.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
# Realizar una segunda confirmación que solo registre un único cambio.
|
||||
CONTAR=0
|
||||
para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
|
||||
si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
|
||||
CONTAR=$((CONTAR+1))
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
test "$COUNT" -ge 2
|
||||
prueba "$COUNT" -ge 2
|
||||
|
||||
# And a third one.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
# Y un tercero.
|
||||
CONTAR=0
|
||||
para confirmar en $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d''); hacer
|
||||
si prueba "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; entonces
|
||||
CONTAR=$((CONTAR+1))
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
test "$COUNT" -ge 3
|
||||
prueba "$COUNT" -ge 3
|
|
@ -1,27 +1,27 @@
|
|||
title = The command line
|
||||
cards =
|
||||
título = La línea de comando
|
||||
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]
|
||||
|
||||
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!
|
||||
test -d .git
|
||||
# ¡Inicializa la máquina del tiempo!
|
||||
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.
|
|
@ -1,33 +1,33 @@
|
|||
title = Your first commit
|
||||
cards = commit-auto
|
||||
título = Tu primer compromiso
|
||||
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]
|
||||
|
||||
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")
|
||||
git rev-parse HEAD
|
||||
# Hacer una instantánea del vaso (un "compromiso")
|
||||
git rev-parse CABEZA
|
||||
|
||||
# Change the contents of the glass!
|
||||
! test "$(cat glass)" = "The glass is full of water."
|
||||
# ¡Cambia el contenido del vaso!
|
||||
! test "$(cat glass)" = "El vaso está lleno de agua."
|
||||
|
||||
# And make a second commit!
|
||||
git rev-parse HEAD^ && ! test "$(git show main:glass)" = "The glass is full of water."
|
||||
# ¡Y haz un segundo compromiso!
|
||||
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".
|
|
@ -1,42 +1,42 @@
|
|||
title = Making backups
|
||||
cards =
|
||||
título = Hacer copias de seguridad
|
||||
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
|
||||
- To track my projects over time" >> form2_final.txt
|
||||
- Para poder deshacer errores
|
||||
- Para realizar un seguimiento de mis proyectos a lo largo del tiempo" >> form2_final.txt
|
||||
|
||||
cp form2_final.txt form2_really_final.txt
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Add another line to form2_really_final.txt!
|
||||
test "$(cat form2_really_final.txt | wc -l )" -ge 5
|
||||
# ¡Agrega otra línea a form2_really_final.txt!
|
||||
prueba "$(cat form2_really_final.txt | wc -l )" -ge 5
|
|
@ -1,23 +1,23 @@
|
|||
title = Enter the time machine
|
||||
cards = init
|
||||
title = Entra en la máquina del tiempo
|
||||
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!
|
||||
test -d .git
|
||||
# ¡Inicializa la máquina del tiempo!
|
||||
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!
|
|
@ -1,52 +1,52 @@
|
|||
title = Working together
|
||||
cards = pull commit-auto push
|
||||
título = Trabajando juntos
|
||||
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]
|
||||
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial version"
|
||||
git push -u teacher main
|
||||
echo "~ Lista de estudiantes actuales ~" > estudiantes
|
||||
git agregar.
|
||||
git commit -m "Versión inicial"
|
||||
git push -u profesor principal
|
||||
|
||||
git update-ref -d refs/remotes/teacher/main
|
||||
|
||||
[setup teacher]
|
||||
[profesor de configuración]
|
||||
|
||||
git reset --hard main
|
||||
git reset --hard principal
|
||||
|
||||
echo "
|
||||
- Sam
|
||||
- Alex" >> students
|
||||
eco "
|
||||
-sam
|
||||
- Alex" >> estudiantes
|
||||
|
||||
git add .
|
||||
git commit -m "Added two students"
|
||||
git agregar.
|
||||
git commit -m "Se agregaron dos estudiantes"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Get the second commit from your teacher using `git pull`.
|
||||
test "$(git log --oneline teacher/main | wc -l)" -ge 2
|
||||
# Obtén el segundo compromiso de tu maestro usando `git pull`.
|
||||
prueba "$(git log --oneline teacher/main | wc -l)" -ge 2
|
||||
|
||||
# Add your name to the list of students
|
||||
test "$(cat students |wc -l)" -ge 5
|
||||
# Agrega tu nombre a la lista de estudiantes.
|
||||
prueba "$(estudiantes de gato |wc -l)" -ge 5
|
||||
|
||||
# Commit your result.
|
||||
test "$(git show main:students |wc -l)" -ge 5
|
||||
# Confirma tu resultado.
|
||||
prueba "$(git show main:estudiantes |wc -l)" -ge 5
|
||||
|
||||
[win teacher]
|
||||
[ganar maestro]
|
||||
|
||||
# And use `git push` to send it to your teacher!
|
||||
test "$(git show main:students |wc -l)" -ge 5
|
||||
# ¡Y usa `git push` para enviárselo a tu profesor!
|
||||
prueba "$(git show main:estudiantes |wc -l)" -ge 5
|
|
@ -1,42 +1,42 @@
|
|||
title = Living dangerously
|
||||
cards =
|
||||
título = Vivir peligrosamente
|
||||
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
|
||||
- To track my projects over time" >> form.txt
|
||||
- Para poder deshacer errores
|
||||
- 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!
|
||||
test "$(cat form.txt | wc -l )" -ge 5
|
||||
# ¡Agrega otra línea al formulario.txt!
|
||||
prueba "$(cat form.txt | wc -l )" -ge 5
|
|
@ -1,6 +1,6 @@
|
|||
risky
|
||||
copies
|
||||
init
|
||||
arriesgado
|
||||
copias
|
||||
en eso
|
||||
cli
|
||||
commit
|
||||
remote
|
||||
comprometerse
|
||||
remoto
|
|
@ -1,38 +1,38 @@
|
|||
title = Welcome to time travel school!
|
||||
cards = config-name commit-auto checkout
|
||||
title = ¡Bienvenido a la escuela de viajes en el tiempo!
|
||||
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.
|
||||
[ ] So I don't have to keep copies of all my essays.
|
||||
[ ] To collaborate with other time travel students.
|
||||
[ ] Other, please specify:" > form
|
||||
[ ] Para asegurarme de que mi gato no se coma mi tarea.
|
||||
[] Así que no tengo que guardar copias de todos mis ensayos.
|
||||
[] Colaborar con otros estudiantes de viajes en el tiempo.
|
||||
[ ] Otro, por favor especifique:" > formulario
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
test "$(git config user.name)" != "You" && cat form | grep -v Signature && echo "
|
||||
Signature: $(git config user.name)" >> form
|
||||
prueba "$(git config user.name)" != "Tú" && forma de gato | grep -v Firma && eco "
|
||||
Firma: $(git config user.name)" >> formulario
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Introduce yourself.
|
||||
test "$(git config user.name)" != "You"
|
||||
# Presentarte.
|
||||
prueba "$(git config user.name)" != "Tú"
|
||||
|
||||
# Fill out the enrollment form, and commit it!
|
||||
git show main:form | grep '\[[xX]\]'
|
||||
# ¡Rellene el formulario de inscripción y confíelo!
|
||||
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!"
|
|
@ -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
|
||||
- echo content > file
|
||||
- cat file
|
||||
- mkdir dir
|
||||
- es
|
||||
- contenido de eco> archivo
|
||||
- archivo de gato
|
||||
- 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
|
||||
echo "ppl p" > riddle/consonants
|
||||
echo "ae ie" > riddle/vowels
|
||||
acertijo mkdir
|
||||
echo "ppl p" > acertijo/consonantes
|
||||
echo "ae ie" > acertijo/vocales
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
cat answer | grep -i "apple \\?pie"
|
||||
respuesta del gato | grep -i "manzana \\?tarta"
|
|
@ -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
|
||||
echo "Ho" > file2
|
||||
echo "Hu" > file3
|
||||
git hash-object -w file1
|
||||
git hash-object -w file2
|
||||
git hash-object -w file3
|
||||
eco "Hola" > archivo1
|
||||
eco "Ho" > archivo2
|
||||
eco "Hu" > archivo3
|
||||
git hash-objeto -w archivo1
|
||||
git hash-objeto -w archivo2
|
||||
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
|
|
@ -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 "This blob really should not exist" | git hash-object -w --stdin
|
||||
echo "This is a virus" | git hash-object -w --stdin
|
||||
echo "Mi contraseña maestra es a1b2c3d4e5" | git hash-objeto -w --stdin
|
||||
echo "Esta mancha realmente no debería existir" | git hash-objeto -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
|
|
@ -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
|
||||
git add .
|
||||
git write-tree
|
||||
toque archivo_vacío
|
||||
git agregar.
|
||||
árbol de escritura de git
|
||||
|
||||
rm empty_file
|
||||
git update-index --remove empty_file
|
||||
rm archivo_vacío
|
||||
git update-index --eliminar archivo_vacío
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
touch empty_file
|
||||
git add .
|
||||
git write-tree
|
||||
toque archivo_vacío
|
||||
git agregar.
|
||||
árbol de escritura de git
|
||||
|
||||
rm empty_file
|
||||
git update-index --remove empty_file
|
||||
rm archivo_vacío
|
||||
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
|
|
@ -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
|
||||
FIRST_COMMIT=$(git commit-tree 4b82 -m 'First commit :O')
|
||||
SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Second commit :D')
|
||||
THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Third commit \o/')
|
||||
árbol de escritura de git
|
||||
FIRST_COMMIT=$(git commit-tree 4b82 -m 'Primera confirmación:O')
|
||||
SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Segundo compromiso :D')
|
||||
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
|
||||
echo a commit named $COMMIT
|
||||
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then
|
||||
return 0
|
||||
para COMMITIR en $COMMITS; hacer
|
||||
hacer eco de una confirmación llamada $COMMIT
|
||||
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; entonces
|
||||
regresar 0
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
return 1
|
||||
regresar 1
|
|
@ -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)
|
||||
SOUTH=$(git commit-tree $TREE -m "South")
|
||||
EAST=$(git commit-tree $TREE -m "East" -p $SOUTH)
|
||||
WEST=$(git commit-tree $TREE -m "West" -p $SOUTH)
|
||||
NORTH=$(git commit-tree $TREE -m "Nort" -p $EAST -p $WEST)
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
SUR=$(git commit-tree $TREE -m "Sur")
|
||||
ESTE=$(git commit-tree $ÁRBOL -m "Este" -p $SUR)
|
||||
OESTE=$(git commit-tree $ÁRBOL -m "Oeste" -p $SUR)
|
||||
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
|
||||
# My first parent's parents has to be the same as my second parent's parent.
|
||||
if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then
|
||||
return 0
|
||||
para COMMITIR en $COMMITS; hacer
|
||||
# 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^)" ]; entonces
|
||||
regresar 0
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
return 1
|
||||
regresar 1
|
|
@ -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
|
||||
git update-index --add file
|
||||
echo "mi contenido" > archivo
|
||||
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
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
test "$(git ls-files | wc -l)" -ge 3
|
||||
prueba "$(git ls-files | wc -l)" -ge 3
|
|
@ -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
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo "file 1" > file1
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
git update-index --force-remove file1
|
||||
git update-index --force-remove file2
|
||||
git update-index --force-remove file3
|
||||
git update-index --force-remove archivo1
|
||||
git update-index --force-remove archivo2
|
||||
git update-index --force-remove archivo3
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
test "$(git ls-files | wc -l)" -eq 0
|
||||
prueba "$(git ls-files | wc -l)" -eq 0
|
|
@ -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
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo "file 1" > file1
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
echo "new content" > file1
|
||||
git update-index file1
|
||||
echo "nuevo contenido" > archivo1
|
||||
archivo de índice de actualización de git1
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# This is not really a good test for the winning condition...
|
||||
test "$(git ls-files -s | git hash-object --stdin)" != "10c4b28623e7e44e09f5a596450a50ab7ac31fbe" -a "$(git ls-files | wc -l)" -eq 3
|
||||
# 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
|
|
@ -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 reflog expire
|
||||
git podar
|
||||
git reflog expira
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo foo > foo
|
||||
BLOB=$(git hash-object -w foo)
|
||||
echo bar > bar
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo blabber >> bar
|
||||
git commit -a -m "Second commit"
|
||||
git update-ref refs/important HEAD
|
||||
git update-ref refs/interesting "$BLOB"
|
||||
eco foo > foo
|
||||
BLOB=$(git hash-objeto -w foo)
|
||||
barra de eco > barra
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco parloteo >> barra
|
||||
git commit -a -m "Segundo compromiso"
|
||||
git update-ref refs/CABEZA importante
|
||||
git update-ref refs/interesante "$BLOB"
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo foo > foo
|
||||
BLOB=$(git hash-object -w foo)
|
||||
echo bar > bar
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo blabber >> bar
|
||||
git commit -a -m "Second commit"
|
||||
git update-ref refs/important HEAD
|
||||
git update-ref refs/interesting "$BLOB"
|
||||
eco foo > foo
|
||||
BLOB=$(git hash-objeto -w foo)
|
||||
barra de eco > barra
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco parloteo >> barra
|
||||
git commit -a -m "Segundo compromiso"
|
||||
git update-ref refs/CABEZA importante
|
||||
git update-ref refs/interesante "$BLOB"
|
||||
|
||||
TREE=$(git mktree)
|
||||
git read-tree $TREE
|
||||
ÁRBOL=$(git mktree)
|
||||
git árbol de lectura $ÁRBOL
|
||||
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
|
|
@ -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 write-tree
|
||||
git update-index --force-remove a
|
||||
git update-index --add --cacheinfo 100644,$BLOB,b
|
||||
git write-tree
|
||||
git update-index --force-remove b
|
||||
嫫bol de escritura de git
|
||||
git update-index --forzar-eliminar un
|
||||
璯dice de actualizaci鏮 de git --add --cacheinfo 100644,$BLOB,b
|
||||
嫫bol de escritura de git
|
||||
璯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
|
||||
git cat-file -p $TREE | cut -f1 | cut -f3 -d" "
|
||||
done)
|
||||
ALL_TREE_CHILDREN=$(para 糠BOL en $糠BOLES; hacer
|
||||
git cat-file -p $糠BOL | cortar -f1 | cortar -f3 -d" "
|
||||
hecho)
|
||||
|
||||
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"
|
|
@ -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
|
||||
TREE=$(echo -e "040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\tdir" | git mktree)
|
||||
echo -e "040000 tree $TREE\tdir" | git mktree
|
||||
ÁRBOL=$(echo -e "040000 árbol 4b825dc642cb6eb9a060e54bf8d69288fbee4904\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
|
||||
if [ "$(git cat-file -p $TREE | wc -l)" -eq 1 ]; then
|
||||
if [ "$(git cat-file -p $TREE | cut -f1 | grep tree | wc -l)" -eq 1 ]; then
|
||||
# So the tree has exactly one child, and it is a tree!
|
||||
TREE2=$(git cat-file -p $TREE | cut -f1 | grep tree | cut -f3 -d" ")
|
||||
if [ "$(git cat-file -p $TREE2 | wc -l)" -eq 1 ]; then
|
||||
if [ "$(git cat-file -p $TREE2 | cut -f1 | grep tree | wc -l)" -eq 1 ]; then
|
||||
# Same for its child! \o/
|
||||
return 0
|
||||
para ÁRBOL en $ÁRBOLES; hacer
|
||||
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 ]; entonces
|
||||
# Entonces el árbol tiene exactamente un hijo, ¡y es un árbol!
|
||||
ÁRBOL2=$(git cat-file -p $ÁRBOL | cortar -f1 | árbol grep | cortar -f3 -d" ")
|
||||
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 ]; entonces
|
||||
# ¡Lo mismo para su hijo! \o/
|
||||
regresar 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
return 1
|
||||
regresar 1
|
|
@ -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
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo hello > hello
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
|
||||
|
||||
git update-ref refs/a $BLOB1
|
||||
git update-ref refs/b $BLOB2
|
||||
git update-ref refs/c $TREE
|
||||
git update-ref refs/d $COMMIT
|
||||
git actualización-ref refs/a $BLOB1
|
||||
git actualización-ref refs/b $BLOB2
|
||||
git actualización-ref refs/c $ÁRBOL
|
||||
git actualización-ref refs/d $COMMIT
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
OBJECTS=$(git cat-file --batch-check='%(objectname)' --batch-all-objects | sort)
|
||||
REF_TARGETS=$(git show-ref -s | sort | uniq)
|
||||
test "$OBJECTS" = "$REF_TARGETS"
|
||||
OBJETOS=$(git cat-file --batch-check='%(nombre de objeto)' --batch-all-objects | sort)
|
||||
REF_TARGETS=$(git show-ref -s | ordenar | uniq)
|
||||
prueba "$OBJECTS" = "$REF_TARGETS"
|
|
@ -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
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
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"
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo hello > hello
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
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"
|
||||
|
||||
for REF in $(git for-each-ref --format='%(refname)'); do
|
||||
git update-ref "$REF" "$TREE"
|
||||
done
|
||||
para REF en $(git for-each-ref --format='%(refname)'); hacer
|
||||
git update-ref "$REF" "$ÁRBOL"
|
||||
hecho
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
test "$(git show-ref -s | sort -u)" = "c7863f72467ed8dd44f4b8ffdb8b57ca7d91dc9e"
|
||||
prueba "$(git show-ref -s | sort -u)" = "c7863f72467ed8dd44f4b8ffdb8b57ca7d91dc9e"
|
|
@ -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
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
|
||||
|
||||
git update-ref refs/best_blob_ever "$BLOB1"
|
||||
git update-ref refs/beautiful_commit "$COMMIT"
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo hello > hello
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
||||
eco hola > hola
|
||||
eco mundo > mundo
|
||||
BLOB1=$(git hash-object -w hola)
|
||||
BLOB2=$(git hash-object -w mundo)
|
||||
git agregar.
|
||||
ÁRBOL=$(git escribir-árbol)
|
||||
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
|
||||
|
||||
git update-ref refs/best_blob_ever "$BLOB1"
|
||||
git update-ref refs/beautiful_commit "$COMMIT"
|
||||
|
||||
for REF in $(git for-each-ref --format='%(refname)'); do
|
||||
git update-ref -d "$REF"
|
||||
done
|
||||
para REF en $(git for-each-ref --format='%(refname)'); hacer
|
||||
git actualización-ref -d "$REF"
|
||||
hecho
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
test "$(git show-ref | wc -l)" -eq 0
|
||||
prueba "$(git show-ref | wc -l)" -eq 0
|
|
@ -1,18 +1,18 @@
|
|||
welcome
|
||||
basics
|
||||
blob-create
|
||||
blob-remove
|
||||
index-add
|
||||
index-remove
|
||||
index-update
|
||||
tree-create
|
||||
tree-read
|
||||
tree-nested
|
||||
commit-create
|
||||
commit-parents
|
||||
commit-rhombus
|
||||
ref-create
|
||||
ref-move
|
||||
ref-remove
|
||||
symref-create
|
||||
symref-no-deref
|
||||
bienvenido
|
||||
lo esencial
|
||||
creación de blobs
|
||||
eliminar blobs
|
||||
agregar índice
|
||||
eliminar índice
|
||||
actualización del índice
|
||||
crear arbol
|
||||
lectura de árbol
|
||||
anidado en los árboles
|
||||
comprometerse-crear
|
||||
padres comprometidos
|
||||
compromiso-rombo
|
||||
ref-crear
|
||||
movimiento de referencia
|
||||
ref-eliminar
|
||||
crear symref
|
||||
symref-no-deref
|
|
@ -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)
|
||||
git update-ref refs/double "$BLOB"
|
||||
git symbolic-ref refs/rainbow refs/double
|
||||
git update-ref refs/doble "$BLOB"
|
||||
git simb鏊ico-ref refs/arco甏is refs/doble
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
git symbolic-ref refs/rainbow
|
||||
git simb鏊ico-ref refs/arco iris
|
|
@ -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)
|
||||
- configuration (allows you to specify remote repositories, for example)
|
||||
- working with local files (which is, uh, arguably pretty important :P)
|
||||
- etiquetar objetos (son el cuarto tipo de objeto, un poco como referencias con una descripción y un autor)
|
||||
- configuración (le permite especificar repositorios remotos, por ejemplo)
|
||||
- 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)
|
||||
BLOB2=$(echo very | git hash-object -w --stdin)
|
||||
BLOB1=$(echo delicioso | git hash-object -w --stdin)
|
||||
BLOB2=$(echo muy | git hash-object -w --stdin)
|
||||
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)
|
||||
BLOB2=$(echo very | git hash-object -w --stdin)
|
||||
BLOB1=$(echo delicioso | git hash-object -w --stdin)
|
||||
BLOB2=$(echo muy | git hash-object -w --stdin)
|
||||
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"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
git symbolic-ref refs/fries && return 1
|
||||
test "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6"
|
||||
git simbólico-ref refs/fries && retorno 1
|
||||
prueba "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6"
|
|
@ -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
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
[setup goal]
|
||||
[objetivo de configuración]
|
||||
|
||||
echo "file 1" > file1
|
||||
echo "file 2" > file2
|
||||
echo "file 3" > file3
|
||||
git add .
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
eco "archivo 3" > archivo3
|
||||
git agregar.
|
||||
|
||||
git write-tree
|
||||
árbol de escritura de git
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
git cat-file -p 21a638f28022064c1f1df20844278b494d197979
|
||||
git cat-file -p 21a638f28022064c1f1df20844278b494d197979
|
|
@ -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 "I'm the right arm" > arm2
|
||||
mkdir hip
|
||||
echo "I'm the left leg" > hip/leg1
|
||||
echo "I'm the right leg" > hip/leg2
|
||||
git add .
|
||||
git write-tree
|
||||
echo "Soy el brazo izquierdo" > arm1
|
||||
echo "Soy el brazo derecho" > arm2
|
||||
cadera mkdir
|
||||
echo "Soy la pierna izquierda" > cadera/pierna1
|
||||
echo "Soy la pierna derecha" > cadera/pierna2
|
||||
git agregar.
|
||||
á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_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
|
||||
TREE_CHILD=$(git cat-file -p $OUTER_TREE | cut -f1 | grep tree | cut -d" " -f3)
|
||||
si [ $NUMBER_OF_BLOB_CHILDREN -eq 2 -a $NUMBER_OF_TREE_CHILDREN -eq 1 ]; entonces
|
||||
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)
|
||||
if [ $NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD -eq 2 ]; then
|
||||
return 0
|
||||
si [ $NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD -eq 2 ]; entonces
|
||||
regresar 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
hecho
|
||||
|
||||
return 1
|
||||
regresar 1
|
|
@ -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
|
||||
echo "file 2" > file2
|
||||
git add .
|
||||
git write-tree
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
git agregar.
|
||||
árbol de escritura de git
|
||||
|
||||
rm *
|
||||
echo "file A" > fileA
|
||||
echo "file B" > fileB
|
||||
echo "file C" > fileC
|
||||
git add .
|
||||
TRIPLE_TREE=$(git write-tree)
|
||||
habitación *
|
||||
echo "archivo A" > archivoA
|
||||
echo "archivo B" > archivoB
|
||||
echo "archivo C" > archivoC
|
||||
git agregar.
|
||||
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
|
||||
echo "file 2" > file2
|
||||
git add .
|
||||
git write-tree
|
||||
eco "archivo 1" > archivo1
|
||||
eco "archivo 2" > archivo2
|
||||
git agregar.
|
||||
árbol de escritura de git
|
||||
|
||||
rm *
|
||||
echo "file A" > fileA
|
||||
echo "file B" > fileB
|
||||
echo "file C" > fileC
|
||||
git add .
|
||||
TRIPLE_TREE=$(git write-tree)
|
||||
habitación *
|
||||
echo "archivo A" > archivoA
|
||||
echo "archivo B" > archivoB
|
||||
echo "archivo C" > archivoC
|
||||
git agregar.
|
||||
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
|
|
@ -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
|
|
@ -1,47 +1,47 @@
|
|||
title = Contradictions
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Contradicciones
|
||||
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
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "Acabo de despertar. Tiene hambre". > sam
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
git checkout -b pancakes
|
||||
echo "Had blueberry pancakes with maple syrup for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Pancakes!"
|
||||
git checkout -b panqueques
|
||||
echo "Comí panqueques de arándanos con jarabe de arce para desayunar". > sam
|
||||
git agregar.
|
||||
git commit -m "¡Panqueques!"
|
||||
|
||||
echo "
|
||||
Is at work." >> sam
|
||||
git commit -am "Go to work"
|
||||
eco "
|
||||
Está en el trabajo." >> sam
|
||||
git commit -am "Ir a trabajar"
|
||||
|
||||
git checkout -b muesli main
|
||||
echo "Had muesli with oats and strawberries for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Muesli!"
|
||||
git checkout -b muesli principal
|
||||
echo "Comí muesli con avena y fresas para desayunar." > sam
|
||||
git agregar.
|
||||
git commit -m "¡Muesli!"
|
||||
|
||||
echo "
|
||||
Is at work." >> sam
|
||||
git commit -am "Go to work"
|
||||
eco "
|
||||
Está en el trabajo." >> sam
|
||||
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^^)"
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Yum, that sounds like a good breakfast!
|
||||
¡Mmm, eso suena como un buen desayuno!
|
|
@ -1,82 +1,82 @@
|
|||
title = Merging timelines
|
||||
cards = checkout commit-auto merge
|
||||
título = Fusionar líneas de tiempo
|
||||
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 commit -m "The Beginning"
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You buy a baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You eat the baguette"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Te comes la baguette"
|
||||
|
||||
git checkout HEAD~2
|
||||
echo "You do not have a baguette.
|
||||
git pago CABEZA~2
|
||||
echo "No tienes baguette.
|
||||
|
||||
You have coffee.
|
||||
Tienes café.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy some coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You drink the coffee"
|
||||
No tienes donut." > tu
|
||||
git agregar.
|
||||
git commit -m "Tú bebes el café"
|
||||
|
||||
git checkout HEAD~2
|
||||
echo "You do not have a baguette.
|
||||
git pago CABEZA~2
|
||||
echo "No tienes baguette.
|
||||
|
||||
You do not have coffee.
|
||||
No tienes café.
|
||||
|
||||
You have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a donut"
|
||||
Tienes un donut." > tú
|
||||
git agregar.
|
||||
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
|
||||
git add .
|
||||
git commit -m "You eat the donut"
|
||||
Te comiste un donut." > tú
|
||||
git agregar.
|
||||
git commit -m "Te comes el donut"
|
||||
|
||||
git checkout --detach
|
||||
git branch -D main
|
||||
git checkout --separar
|
||||
rama git -D principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Build a situation where you consumed a baguette, a coffee, *and* a 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"; }
|
||||
# Crea una situación en la que hayas consumido una barra de pan, un café y *y* un 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.
|
||||
test "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2
|
||||
# Estar en un compromiso de fusión.
|
||||
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...
|
|
@ -1,54 +1,54 @@
|
|||
title = Abort a merge
|
||||
cards = checkout commit-auto merge merge-abort
|
||||
title = Cancelar una fusión
|
||||
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
|
||||
git merge --abort
|
||||
when you are in a merge process.
|
||||
En estas situaciones, puede cancelar la fusión para fusionarla más tarde. Usar
|
||||
git fusionar --abortar
|
||||
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 commit -m "Start"
|
||||
git agregar.
|
||||
git commit -m "Inicio"
|
||||
|
||||
echo "Walking down the Main Lane." >> you
|
||||
echo "Caminando por el carril principal". >> tu
|
||||
|
||||
git add .
|
||||
git commit -m "Main Lane"
|
||||
git agregar.
|
||||
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 commit -m "Side Lane"
|
||||
git agregar.
|
||||
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
|
||||
touch .git/secretfile
|
||||
si prueba -f .git/MERGE_HEAD; entonces
|
||||
toque .git/secretfile
|
||||
fi
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# You tried to merge?
|
||||
test -f .git/secretfile
|
||||
# ¿Intentaste fusionarte?
|
||||
prueba -f .git/archivosecreto
|
||||
|
||||
# You aborted to merge?
|
||||
test -f .git/secretfile && ! test -f .git/MERGE_HEAD && ! git rev-parse HEAD^^
|
||||
# ¿Abortaste la fusión?
|
||||
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...
|
|
@ -1,2 +1,2 @@
|
|||
merge
|
||||
conflict
|
||||
unir
|
||||
conflicto
|
|
@ -1,47 +1,47 @@
|
|||
title = Friend
|
||||
cards = pull push commit-auto checkout
|
||||
título = Amigo
|
||||
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
|
||||
git add .
|
||||
git commit -m "One line"
|
||||
echo "Línea 1" > ensayo
|
||||
git agregar.
|
||||
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
|
||||
echo "Line 2, gnihihi" >> essay
|
||||
git commit -am "Another line"
|
||||
git pago principal
|
||||
echo "Línea 2, gnihihi" >> ensayo
|
||||
git commit -am "Otra línea"
|
||||
|
||||
[actions friend]
|
||||
[acciones amigo]
|
||||
|
||||
if test "$(git log --oneline | wc -l)" -eq 3; then
|
||||
git reset --hard main # Necessary because the working directory isn't updated when we push to the friend.
|
||||
echo "Line 4, blurbblubb" >> essay
|
||||
git commit -am "Final line"
|
||||
hint "Oh nice, I added a fourth line!"
|
||||
si prueba "$(git log --oneline | wc -l)" -eq 3; entonces
|
||||
git reset --hard main # Necesario porque el directorio de trabajo no se actualiza cuando enviamos al amigo.
|
||||
echo "Línea 4, Blubbblubb" >> ensayo
|
||||
git commit -am "Línea final"
|
||||
pista "¡Qué bien, agregué una cuarta línea!"
|
||||
fi
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Got the second line from your friend
|
||||
git show HEAD:essay | grep gnihihi
|
||||
# Recibí la segunda línea de tu amigo.
|
||||
git show HEAD:ensayo | grep gnihihi
|
||||
|
||||
# Got the fourth line from your friend.
|
||||
git show HEAD:essay | grep blurbblubb
|
||||
# Recibí la cuarta línea de tu amigo.
|
||||
git show HEAD:ensayo | grep blubbblubb
|
||||
|
||||
[win friend]
|
||||
[gana amigo]
|
||||
|
||||
# The friend got a third line from you
|
||||
test "$(git show HEAD:essay | wc -l)" -ge 3
|
||||
# El amigo recibió una tercera línea tuya
|
||||
prueba "$(git show HEAD:ensayo | wc -l)" -ge 3
|
||||
|
||||
# The friend got a fifth line from you
|
||||
test "$(git show HEAD:essay | wc -l)" -ge 5
|
||||
# El amigo recibió una quinta línea tuya
|
||||
prueba "$(git show HEAD:ensayo | wc -l)" -ge 5
|
|
@ -1,33 +1,33 @@
|
|||
title = Problems
|
||||
cards = checkout add pull push commit-auto merge
|
||||
título = Problemas
|
||||
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
|
||||
git add .
|
||||
git commit -m "initial"
|
||||
echo "¿El cobertizo para bicicletas debería ser ???" > archivo
|
||||
git agregar.
|
||||
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
|
||||
git commit -a -m "friends version"
|
||||
echo "El cobertizo para bicicletas debe ser azul" > archivo
|
||||
git commit -a -m "versión de amigos"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Commit your local changes.
|
||||
test "$(git status -s)" = ""
|
||||
# Confirme sus cambios locales.
|
||||
prueba "$(git status -s)" = ""
|
||||
|
||||
[win friend]
|
||||
[gana amigo]
|
||||
|
||||
# Look at your friend's suggestion, make a compromise, and push it back.
|
||||
git rev-parse main^ && test "$(git rev-parse main^1^)" = "$(git rev-parse main^2^)"
|
||||
# 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^)"
|
|
@ -1,2 +1,2 @@
|
|||
friend
|
||||
problems
|
||||
amigo
|
||||
problemas
|
|
@ -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]
|
|
@ -1,22 +1,22 @@
|
|||
title = Sandbox with a remote
|
||||
cards = checkout commit-auto pull fetch push
|
||||
title = Sandbox con control remoto
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "Línea 1" > ensayo
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
git push -u friend main
|
||||
git push -u amigo principal
|
||||
|
||||
[setup friend]
|
||||
[amigo de configuración]
|
||||
|
||||
git checkout main
|
||||
echo "Line 2" >> essay
|
||||
git commit -am "Another line"
|
||||
git pago principal
|
||||
echo "Línea 2" >> ensayo
|
||||
git commit -am "Otra línea"
|
|
@ -1,3 +1,3 @@
|
|||
empty
|
||||
remote
|
||||
three-commits
|
||||
vacío
|
||||
remoto
|
||||
tres compromisos
|
|
@ -1,26 +1,26 @@
|
|||
title = Sandbox with three commits
|
||||
cards = checkout add reset-file checkout-file commit merge rebase
|
||||
título = Sandbox con tres confirmaciones
|
||||
tarjetas = pagar agregar restablecer-archivo pagar-archivo confirmar fusionar rebase
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "You wake up." > you
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "Te despiertas". > tu
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
echo "You drink coffee." >> you
|
||||
git commit -am "First things first"
|
||||
echo "Bebes café". >> tu
|
||||
git commit -am "Lo primero es lo primero"
|
||||
|
||||
echo "You hear a knock on the door." >> you
|
||||
git commit -am "Who's there?"
|
||||
echo "Escuchas un golpe en la puerta". >> tu
|
||||
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!
|
||||
- Create and delete some tags!
|
||||
- Make a timeline that's completely independent of the rest!
|
||||
- ¡Haz un compromiso que combine tres líneas de tiempo a la vez!
|
||||
- ¡Crea y elimina algunas etiquetas!
|
||||
- ¡Crea una línea de tiempo que sea completamente independiente del resto!
|
|
@ -1,30 +1,30 @@
|
|||
title = Undo a bad commit
|
||||
cards = reset commit-a
|
||||
title = Deshacer una confirmación incorrecta
|
||||
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.
|
||||
- And it resets the index to that commit.
|
||||
- Restablece la referencia de la rama actual a la confirmación que especifiques.
|
||||
- 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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "1 2 3 4 5 6 7 8 9 11" > numbers
|
||||
git commit -am "More numberrrrrs"
|
||||
eco "1 2 3 4" > números
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco "1 2 3 4 5 6 7 8 9 11" > números
|
||||
git commit -am "Más númerosrrrrs"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# In the last main commit, the numbers file contains the numbers from 1 to 10.
|
||||
test "$(git show main:numbers)" = "1 2 3 4 5 6 7 8 9 10"
|
||||
# The commit message of that commit is "More numbers".
|
||||
git log -1 --oneline | grep "More numbers"
|
||||
# The commit with the typo is not part of the main branch anymore.
|
||||
git log --oneline | grep -v "rrrrr"
|
||||
# En la última confirmación principal, el archivo de números contiene los números del 1 al 10.
|
||||
prueba "$(git show main:números)" = "1 2 3 4 5 6 7 8 9 10"
|
||||
# El mensaje de confirmación de esa confirmación es "Más números".
|
||||
git log -1 --oneline | grep "Más números"
|
||||
# La confirmación con el error tipográfico ya no forma parte de la rama principal.
|
||||
registro de git --oneline | grep -v "rrrrr"
|
|
@ -1,54 +1,54 @@
|
|||
title = I pushed something broken
|
||||
cards = revert push
|
||||
título = Empujé algo roto
|
||||
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
|
||||
git add .
|
||||
git commit -m fine
|
||||
echo "this is fine
|
||||
?" > texto
|
||||
git agregar.
|
||||
git commit -m bien
|
||||
eco "esto está bien
|
||||
|
||||
this is also fine
|
||||
esto también está bien
|
||||
|
||||
?
|
||||
|
||||
?" > text
|
||||
git commit -am "also fine"
|
||||
echo "this is fine
|
||||
?" > texto
|
||||
git commit -estoy "también bien"
|
||||
eco "esto está bien
|
||||
|
||||
this is also fine
|
||||
esto también está bien
|
||||
|
||||
this is very bad
|
||||
esto es muy malo
|
||||
|
||||
?" > text
|
||||
git commit -am "very bad"
|
||||
echo "this is fine
|
||||
?" > texto
|
||||
git commit -soy "muy malo"
|
||||
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
|
||||
git commit -am "fine again"
|
||||
esto está bien otra vez" > texto
|
||||
git commit -estoy "bien otra vez"
|
||||
|
||||
git push team main
|
||||
git branch -u team/main main
|
||||
equipo principal de git push
|
||||
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.
|
||||
! { git show main:text | grep -q "very bad"; }
|
||||
# And the history has not been modified.
|
||||
git show main^:text | grep -q "very bad"
|
||||
# La rama principal del equipo ya no contiene lo malo.
|
||||
! { git show principal:texto | grep -q "muy malo"; }
|
||||
# Y el historial no ha sido modificado.
|
||||
git show principal^:texto | grep -q "muy malo"
|
|
@ -1,26 +1,26 @@
|
|||
title = Go back to where you were before
|
||||
cards = checkout reflog
|
||||
title = Vuelve a donde estabas antes
|
||||
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
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
for i in {1..10}; do
|
||||
git commit --allow-empty -m $i
|
||||
git branch $i
|
||||
done
|
||||
git checkout 3
|
||||
git checkout main
|
||||
para i en {1..10}; hacer
|
||||
git confirmar --allow-empty -m $i
|
||||
rama git $i
|
||||
hecho
|
||||
git pago 3
|
||||
git pago principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Find out where you've been before, and go back there!
|
||||
test "$(git rev-parse HEAD)" = "$(git rev-parse 3)"
|
||||
# ¡Descubre dónde has estado antes y regresa allí!
|
||||
prueba "$(git rev-parse HEAD)" = "$(git rev-parse 3)"
|
|
@ -1,22 +1,22 @@
|
|||
title = Restore a deleted file
|
||||
cards = checkout
|
||||
title = Restaurar un archivo eliminado
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "important content" > essay
|
||||
git commit -am "Improve essay"
|
||||
rm essay
|
||||
eco importante > ensayo
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
echo "contenido importante" > ensayo
|
||||
git commit -am "Mejorar ensayo"
|
||||
ensayo rm
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Restore the essay to contain "important content"
|
||||
test "$(cat essay)" = "important content"
|
||||
# Restaurar el ensayo para que contenga "contenido importante"
|
||||
test "$(cat essay)" = "contenido importante"
|
|
@ -1,21 +1,21 @@
|
|||
title = Restore a file from the past
|
||||
cards = checkout checkout-from commit
|
||||
title = Restaurar un archivo del pasado
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "bad version" > essay
|
||||
git commit -am "\"Improve\" essay"
|
||||
echo "buena versión" > ensayo
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
echo "mala versión" > ensayo
|
||||
git commit -am "\"Mejorar\" ensayo"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Get the first version of your essay, and make a new commit with it.
|
||||
test "$(git show main:essay)" = "good version"
|
||||
# Obtenga la primera versión de su ensayo y haga un nuevo compromiso con él.
|
||||
test "$(git show main:essay)" = "buena versión"
|
|
@ -1,5 +1,5 @@
|
|||
restore-a-file
|
||||
restore-a-file-from-the-past
|
||||
bad-commit
|
||||
pushed-something-broken
|
||||
reflog
|
||||
restaurar un archivo
|
||||
restaurar-un-archivo-del-pasado
|
||||
mal compromiso
|
||||
empujó-algo-roto
|
||||
volver a registrar
|
|
@ -1,5 +1,5 @@
|
|||
stash
|
||||
stash-pop
|
||||
stash-clear
|
||||
stash-branch
|
||||
stash-merge
|
||||
reserva
|
||||
alijo-pop
|
||||
alijo claro
|
||||
rama de alijo
|
||||
fusión de alijo
|
|
@ -1,12 +1,12 @@
|
|||
title = Stashing
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Escondite
|
||||
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
|
||||
put your current changes aside temporarily. To do so, you can use the stash function. Use
|
||||
git stash push
|
||||
to add your current changes to the stash stack.
|
||||
Te encontrarás con situaciones en las que estás trabajando en tu proyecto pero necesitas
|
||||
deje a un lado sus cambios actuales temporalmente. Para hacerlo, puede utilizar la función de almacenamiento. Usar
|
||||
git alijo empujar
|
||||
para agregar sus cambios actuales a la pila de almacenamiento.
|
||||
|
||||
---
|
||||
tipp1
|
||||
|
@ -15,31 +15,31 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "Apple Pie:" > recipe
|
||||
echo "Tarta de manzana:" > receta
|
||||
|
||||
git add .
|
||||
git commit -m "creating a recipe"
|
||||
git agregar.
|
||||
git commit -m "creando una receta"
|
||||
|
||||
echo "- 4 Apples" >> recipe
|
||||
echo "- 4 manzanas" >> receta
|
||||
|
||||
git add .
|
||||
git commit -m "Adding ingredients"
|
||||
git agregar.
|
||||
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?
|
||||
test "$(git stash list | wc -l)" -ge 1
|
||||
# ¿Escondiste los cambios actuales?
|
||||
prueba "$(git stash list | wc -l)" -ge 1
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Nice stash you got there! :)
|
||||
¡Qué buen alijo tienes ahí! :)
|
|
@ -1,14 +1,14 @@
|
|||
title = Branch from stash
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Rama del alijo
|
||||
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
|
||||
create a new branch from your stashed changes. Just use
|
||||
git stash branch <branchname> <stash>
|
||||
If you just want to use the latest stash entry, you can leave the <stash> option empty.
|
||||
Si desea conservar los cambios pero no pertenecen a la rama principal, puede hacerlo fácilmente
|
||||
cree una nueva rama a partir de sus cambios guardados. Solo usa
|
||||
git stash rama <nombre de rama> <alijo>
|
||||
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
|
||||
|
@ -17,32 +17,32 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "Apple Pie:" > recipe
|
||||
echo "Tarta de manzana:" > receta
|
||||
|
||||
git add .
|
||||
git commit -m "creating a recipe"
|
||||
git agregar.
|
||||
git commit -m "creando una receta"
|
||||
|
||||
echo "- 4 Apples" >> recipe
|
||||
echo "- 4 manzanas" >> receta
|
||||
|
||||
git add .
|
||||
git commit -m "Adding ingredients"
|
||||
git agregar.
|
||||
git commit -m "Agregar ingredientes"
|
||||
|
||||
echo "- 500g Flour" >> recipe
|
||||
git stash push
|
||||
echo "- 500g Harina" >> receta
|
||||
git alijo empujar
|
||||
|
||||
git checkout main
|
||||
git pago principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you create a new branch from the stashed changes?
|
||||
test "$(git branch --list| wc -l)" -ge 2
|
||||
# ¿Creaste una nueva rama a partir de los cambios ocultos?
|
||||
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! :)
|
|
@ -1,17 +1,17 @@
|
|||
title = Clear the Stash
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Limpiar el alijo
|
||||
tarjetas = pago confirmar-fusión automática restablecer-hard
|
||||
|
||||
[description]
|
||||
[descripción]
|
||||
|
||||
If you want to inspect your stash stack, use the command
|
||||
git stash list
|
||||
Si desea inspeccionar su pila de alijo, use el comando
|
||||
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
|
||||
git stash clear
|
||||
If you only want to discard a certain stash entry, you can use
|
||||
git stash drop <stash>
|
||||
Oh, ¿no quieres conservar tus cambios escondidos? ¿Hay demasiados? Luego continúa y limpia la pila con
|
||||
git alijo claro
|
||||
Si solo desea descartar una determinada entrada del alijo, puede utilizar
|
||||
git alijo soltar <alijo>
|
||||
|
||||
Clear your stash stack!
|
||||
¡Limpia tu alijo!
|
||||
|
||||
---
|
||||
tipp1
|
||||
|
@ -20,38 +20,38 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "Apple Pie:" > recipe
|
||||
echo "Tarta de manzana:" > receta
|
||||
|
||||
git add .
|
||||
git commit -m "creating a recipe"
|
||||
git agregar.
|
||||
git commit -m "creando una receta"
|
||||
|
||||
echo "- 4 Apples" >> recipe
|
||||
echo "- 4 manzanas" >> receta
|
||||
|
||||
git add .
|
||||
git commit -m "Adding ingredients"
|
||||
git agregar.
|
||||
git commit -m "Agregar ingredientes"
|
||||
|
||||
echo "- 500g Flour" >> recipe
|
||||
git stash push
|
||||
echo "- 500g Harina" >> receta
|
||||
git alijo empujar
|
||||
|
||||
echo "- 200g Sugar" >> recipe
|
||||
git stash push
|
||||
echo "- 200 g de azúcar" >> receta
|
||||
git alijo empujar
|
||||
|
||||
echo "- Pinch of Salt" >> recipe
|
||||
git stash push
|
||||
echo "- Una pizca de sal" >> receta
|
||||
git alijo empujar
|
||||
|
||||
git checkout main
|
||||
git pago principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you clear your stash stack?
|
||||
test "$(git stash list | wc -l)" -eq 0
|
||||
# ¿Limpiaste tu pila de alijo?
|
||||
prueba "$(lista de alijo de git | wc -l)" -eq 0
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
All clear! :)
|
||||
¡Todo claro! :)
|
|
@ -1,13 +1,13 @@
|
|||
title = Merging popped stash
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
title = Fusionando alijo reventado
|
||||
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
|
||||
a merge conflict! Let's practise this situation.
|
||||
Pop the changes from the stash with
|
||||
git stash pop
|
||||
and resolve the merge conflict. Commit the resolved changes and clear the stash stack afterwards.
|
||||
Cuando desee volver a aplicar sus cambios pero ya continuó trabajando en su archivo, es posible que obtenga
|
||||
¡Un conflicto de fusión! Practiquemos esta situación.
|
||||
Explota los cambios del alijo con
|
||||
git alijo pop
|
||||
y resolver el conflicto de fusión. Confirme los cambios resueltos y borre la pila de alijo después.
|
||||
|
||||
---
|
||||
tipp1
|
||||
|
@ -16,39 +16,39 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "Apple Pie:" > recipe
|
||||
echo "Tarta de manzana:" > receta
|
||||
|
||||
git add .
|
||||
git commit -m "creating a recipe"
|
||||
git agregar.
|
||||
git commit -m "creando una receta"
|
||||
|
||||
echo "- 4 Apples" >> recipe
|
||||
echo "- 4 manzanas" >> receta
|
||||
|
||||
git add .
|
||||
git commit -m "Adding ingredients"
|
||||
git agregar.
|
||||
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 add recipe
|
||||
git pago principal
|
||||
git agregar receta
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you resolve the conflict and commit?
|
||||
{ git show HEAD | grep "Flour"; } && { git show HEAD | grep "Salt"; }
|
||||
# ¿Resolviste el conflicto y te comprometiste?
|
||||
{git show CABEZA | grep "Harina"; } && { git show CABEZA | grep "Sal"; }
|
||||
|
||||
# Did you clear stash stack?
|
||||
test "$(git stash list | wc -l)" -eq 0
|
||||
# ¿Limpiaste la pila de alijo?
|
||||
prueba "$(lista de alijo de git | wc -l)" -eq 0
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Yay, you got your changes back! :)
|
||||
¡Sí, recuperaste tus cambios! :)
|
|
@ -1,12 +1,12 @@
|
|||
title = Pop from Stash
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Pop de Stash
|
||||
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
|
||||
git stash pop
|
||||
This will remove the changes from the stash stack. If you also want to keep the changes on the stash stack, use
|
||||
git stash apply
|
||||
Cuando guardó sus cambios y desea volver a aplicarlos a su directorio de trabajo actual, puede usar
|
||||
git alijo pop
|
||||
Esto eliminará los cambios de la pila de almacenamiento. Si también desea mantener los cambios en la pila de almacenamiento, utilice
|
||||
aplicar git stash
|
||||
|
||||
---
|
||||
tipp1
|
||||
|
@ -15,32 +15,32 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "Apple Pie:" > recipe
|
||||
echo "Tarta de manzana:" > receta
|
||||
|
||||
git add .
|
||||
git commit -m "creating a recipe"
|
||||
git agregar.
|
||||
git commit -m "creando una receta"
|
||||
|
||||
echo "- 4 Apples" >> recipe
|
||||
echo "- 4 manzanas" >> receta
|
||||
|
||||
git add .
|
||||
git commit -m "Adding ingredients"
|
||||
git agregar.
|
||||
git commit -m "Agregar ingredientes"
|
||||
|
||||
echo "- 500g Flour" >> recipe
|
||||
echo "- 500g Harina" >> receta
|
||||
|
||||
git stash push
|
||||
git checkout main
|
||||
git alijo empujar
|
||||
git pago principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you pop the changes from the stash stack?
|
||||
test "$(git stash list | wc -l)" -eq 0
|
||||
# ¿Sacaste los cambios de la pila de alijo?
|
||||
prueba "$(lista de alijo de git | wc -l)" -eq 0
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Yay, you got your changes back! :)
|
||||
¡Sí, recuperaste tus cambios! :)
|
|
@ -1,17 +1,17 @@
|
|||
title = Creating tags
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Creando etiquetas
|
||||
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
|
||||
|
@ -20,34 +20,34 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "event 1" > feature-list
|
||||
echo "evento 1" > lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 1"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 1"
|
||||
|
||||
echo "event 2" >> feature-list
|
||||
echo "evento 2" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 2"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 2"
|
||||
|
||||
echo "event 3" >> feature-list
|
||||
echo "evento 3" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 3"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 3"
|
||||
|
||||
git checkout --detach main
|
||||
git checkout --separar principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you create a new tag?
|
||||
test "$(git tag -l | wc -l)" -ge 1
|
||||
# ¿Creaste una nueva etiqueta?
|
||||
prueba "$(etiqueta git -l | wc -l)" -ge 1
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Nice! You tagged your first commit :)
|
||||
¡Lindo! Etiquetaste tu primer compromiso :)
|
|
@ -1,14 +1,14 @@
|
|||
title = Tagging later
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Etiquetar más tarde
|
||||
tarjetas = pago confirmar-fusión automática restablecer-hard
|
||||
|
||||
[description]
|
||||
[descripción]
|
||||
|
||||
But what happens if you forgot to tag your current commit?
|
||||
No Prob! You can also tag older commits via
|
||||
Pero, ¿qué sucede si olvidaste etiquetar tu compromiso actual?
|
||||
¡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
|
||||
|
@ -17,34 +17,34 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "event 1" > feature-list
|
||||
echo "evento 1" > lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 1"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 1"
|
||||
|
||||
echo "event 2" >> feature-list
|
||||
echo "evento 2" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 2"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 2"
|
||||
|
||||
echo "event 3" >> feature-list
|
||||
echo "evento 3" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 3"
|
||||
git agregar.
|
||||
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)"
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Well done :)
|
||||
Bien hecho :)
|
|
@ -1,58 +1,58 @@
|
|||
title = Remote Tags
|
||||
cards = pull push commit-auto checkout
|
||||
título = Etiquetas remotas
|
||||
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
|
||||
git push <remote> <tag-name>
|
||||
Or all tags with:
|
||||
git push <remote> --tags
|
||||
Puedes empujar una etiqueta con
|
||||
git push <remoto> <nombre-etiqueta>
|
||||
O todas las etiquetas con:
|
||||
git push <remoto> --etiquetas
|
||||
|
||||
Deleting tags on your remote works with:
|
||||
git push <remote> --delete <tag-name>
|
||||
La eliminación de etiquetas en su control remoto funciona con:
|
||||
git push <remoto> --delete <nombre-etiqueta>
|
||||
|
||||
You can also sync
|
||||
git fetch <remote> --prune --prune-tags
|
||||
También puedes sincronizar
|
||||
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.
|
||||
[setup yours]
|
||||
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.
|
||||
[configura el tuyo]
|
||||
|
||||
git checkout main
|
||||
git pago principal
|
||||
|
||||
git checkout main
|
||||
echo "toothbrush sharing" > project-ideas
|
||||
git add .
|
||||
git commit -m "First idea"
|
||||
git pago principal
|
||||
echo "compartir cepillo de dientes" > ideas-proyecto
|
||||
git agregar.
|
||||
git commit -m "Primera idea"
|
||||
|
||||
echo "Is my phone upside down? App" >> project-ideas
|
||||
git commit -am "Another idea"
|
||||
echo "¿Está mi teléfono al revés? Aplicación" >> ideas de proyecto
|
||||
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]
|
||||
# v1 tag in your repo
|
||||
[ganar]
|
||||
# etiqueta v1 en tu repositorio
|
||||
test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)"
|
||||
|
||||
# v2 tag in your repo
|
||||
test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"
|
||||
# etiqueta v2 en tu repositorio
|
||||
prueba "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"
|
||||
|
||||
|
||||
[win friend]
|
||||
[gana amigo]
|
||||
|
||||
# v2 tag in the remote
|
||||
test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"
|
||||
# etiqueta v2 en el control remoto
|
||||
prueba "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)"
|
|
@ -1,13 +1,13 @@
|
|||
title = Removing tags
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
título = Eliminando etiquetas
|
||||
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
|
||||
|
@ -16,38 +16,38 @@ tipp2
|
|||
---
|
||||
tipp3
|
||||
|
||||
[setup]
|
||||
[configuración]
|
||||
|
||||
echo "event 1" > feature-list
|
||||
echo "evento 1" > lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 1"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 1"
|
||||
|
||||
echo "event 2" >> feature-list
|
||||
echo "evento 2" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 2"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 2"
|
||||
|
||||
echo "event 3" >> feature-list
|
||||
echo "evento 3" >> lista de características
|
||||
|
||||
git add .
|
||||
git commit -m "Adding feature 3"
|
||||
git agregar.
|
||||
git commit -m "Agregar característica 3"
|
||||
|
||||
git tag v1 HEAD~2
|
||||
git tag v2 HEAD~1
|
||||
git tag v3
|
||||
etiqueta git v1 CABEZA ~ 2
|
||||
etiqueta git v2 CABEZA ~ 1
|
||||
etiqueta git v3
|
||||
|
||||
git checkout --detach main
|
||||
git checkout --separar principal
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Did you remove all tags?
|
||||
test "$(git tag -l | wc -l)" -eq 0
|
||||
# ¿Eliminaste todas las etiquetas?
|
||||
prueba "$(etiqueta git -l | wc -l)" -eq 0
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
|
||||
|
||||
[congrats]
|
||||
[felicitaciones]
|
||||
|
||||
Well done :)
|
||||
Bien hecho :)
|
|
@ -1,4 +1,4 @@
|
|||
add-tag
|
||||
remove-tag
|
||||
add-tag-later
|
||||
remote-tag
|
||||
añadir etiqueta
|
||||
Remover etiqueta
|
||||
agregar etiqueta más tarde
|
||||
etiqueta remota
|
|
@ -1,31 +1,31 @@
|
|||
title = Getting the last version
|
||||
cards = checkout-file
|
||||
title = Obteniendo la última versión
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
eco "A" >> ensayo.txt
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
echo "B" >> essay.txt
|
||||
git commit -a -m "Improved version"
|
||||
eco "B" >> ensayo.txt
|
||||
git commit -a -m "Versión mejorada"
|
||||
|
||||
echo "C" >> essay.txt
|
||||
git commit -a -m "Even better version"
|
||||
eco "C" >> ensayo.txt
|
||||
git commit -a -m "Versión aún mejor"
|
||||
|
||||
echo "D" >> essay.txt
|
||||
git commit -a -m "Marvelous version"
|
||||
eco "D" >> ensayo.txt
|
||||
git commit -a -m "Versión maravillosa"
|
||||
|
||||
echo "blarg
|
||||
blaaaargh" > essay.txt
|
||||
eco "blarg
|
||||
blaaaargh" > ensayo.txt
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Restore the version from the last commit.
|
||||
cat essay.txt | grep D
|
||||
# Restaurar la versión de la última confirmación.
|
||||
ensayo de gato.txt | grupo D
|
|
@ -1,20 +1,20 @@
|
|||
title = Cloning a repo
|
||||
cards = clone commit-auto pull push
|
||||
título = Clonación de un repositorio
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
eco hola > archivo
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
[win friend]
|
||||
[gana amigo]
|
||||
|
||||
test "$(git show main:file)" != hi
|
||||
prueba "$(git show main:file)" != hola
|
|
@ -1,27 +1,27 @@
|
|||
title = Make a commit \o/
|
||||
cards = add reset checkout commit
|
||||
título = Hacer una confirmación \o/
|
||||
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
|
||||
echo x > b
|
||||
echo x > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo b > b
|
||||
git add b
|
||||
echo c > c
|
||||
eco a > a
|
||||
eco x > b
|
||||
eco x > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco x > a
|
||||
eco b > b
|
||||
git agregar b
|
||||
eco c > c
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# File a contains "x" in the last main commit.
|
||||
test "$(git show main:a)" = x
|
||||
# File b contains "x" in the last main commit.
|
||||
test "$(git show main:b)" = x
|
||||
# File c contains "x" in the last main commit.
|
||||
test "$(git show main:c)" = x
|
||||
# El archivo a contiene "x" en la última confirmación principal.
|
||||
prueba "$(git show main:a)" = x
|
||||
# El archivo b contiene "x" en la última confirmación principal.
|
||||
prueba "$(git show main:b)" = x
|
||||
# El archivo c contiene "x" en la última confirmación principal.
|
||||
prueba "$(git show main:c)" = x
|
|
@ -1,26 +1,26 @@
|
|||
title = Make a commit, but faster!
|
||||
cards = add reset checkout commit commit-a
|
||||
title = ¡Haz un compromiso, pero más rápido!
|
||||
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
|
||||
echo b > b
|
||||
echo c > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo x > b
|
||||
echo x > c
|
||||
eco a > a
|
||||
eco b > b
|
||||
eco c > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco x > a
|
||||
eco x > b
|
||||
eco x > c
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make a commit where all files contain "x".
|
||||
test "$(git show main:a)" = x && test "$(git show main:b)" = x && test "$(git show main:c)" = x
|
||||
# Realizar una confirmación donde todos los archivos contengan "x".
|
||||
prueba "$(git show main:a)" = x && prueba "$(git show main:b)" = x && prueba "$(git show main:c)" = x
|
|
@ -1,35 +1,35 @@
|
|||
title = Fetching from remotes
|
||||
cards = checkout fetch commit-auto
|
||||
title = Obteniendo desde controles remotos
|
||||
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
|
||||
git add .
|
||||
git commit -m "What do you think?"
|
||||
echo "El cobertizo para bicicletas debería ser ???" > propuesta
|
||||
git agregar.
|
||||
git commit -m "¿Qué piensas?"
|
||||
|
||||
[setup friend1]
|
||||
[configurar amigo1]
|
||||
|
||||
git pull yours main
|
||||
echo "The bikeshed should be green" > proposal
|
||||
git commit -am "Green"
|
||||
git tira el tuyo principal
|
||||
echo "El cobertizo para bicicletas debería ser verde" > propuesta
|
||||
git commit -soy "verde"
|
||||
|
||||
[setup friend2]
|
||||
[configurar amigo2]
|
||||
|
||||
git pull yours main
|
||||
echo "The bikeshed should be blue" > proposal
|
||||
git commit -am "Blue"
|
||||
git tira el tuyo principal
|
||||
echo "El cobertizo para bicicletas debería ser azul" > propuesta
|
||||
git commit -am "Azul"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Your proposal is acceptable for friend1.
|
||||
git show main:proposal | git grep green
|
||||
# Your proposal is acceptable for friend2.
|
||||
git show main:proposal | git grep blue
|
||||
# Tu propuesta es aceptable para amigo1.
|
||||
git show principal: propuesta | git grep verde
|
||||
# Tu propuesta es aceptable para amigo2.
|
||||
git show principal: propuesta | git grep azul
|
|
@ -1,27 +1,27 @@
|
|||
title = No sleep required
|
||||
cards = file-new file-delete file-rename
|
||||
t癃ulo = No es necesario dormir
|
||||
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 A really big yellow shelf. > shelf
|
||||
echo A comfortable, yellow bed with yellow cushions. > bed
|
||||
echo Un armario amarillo con muchos cajones. > armario
|
||||
echo Un estante amarillo muy grande. > estante
|
||||
echo Una c鏔oda cama amarilla con cojines amarillos. > cama
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Rename the bed into something else, and give it a new description!
|
||||
NUM_FILES="$(ls | wc -l)"
|
||||
! test -f bed && test "$NUM_FILES" -ge 3 && ! grep -r "yellow bed" .
|
||||
# 。ambia el nombre de la cama por otro y dale una nueva descripci鏮!
|
||||
NUM_FILES="$(ls | ba隳 -l)"
|
||||
! 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!
|
|
@ -1,26 +1,26 @@
|
|||
title = Rename a file in the next commit
|
||||
cards = add reset-file checkout-file mv commit
|
||||
title = Cambiar el nombre de un archivo en la próxima confirmación
|
||||
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
|
||||
echo SPECIAL > b
|
||||
echo x > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo b >> b
|
||||
git add b
|
||||
eco a > a
|
||||
eco ESPECIAL > b
|
||||
eco x > c
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
eco x > a
|
||||
eco b >> b
|
||||
git agregar b
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Make a commit where you rename the file b to "x".
|
||||
test "$(git ls-tree --name-only main)" = "$(echo -e "a\nc\nx")"
|
||||
# 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")"
|
|
@ -1,14 +1,14 @@
|
|||
title = Welcome!
|
||||
cards = init
|
||||
t癃ulo = 、ienvenido!
|
||||
tarjetas = inicio
|
||||
|
||||
[description]
|
||||
[descripci鏮]
|
||||
|
||||
|
||||
[setup]
|
||||
[configuraci鏮]
|
||||
|
||||
rm -rf .git
|
||||
rm-rf.git
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Again, initialize your time machine!
|
||||
test -d .git
|
||||
# ﹑uevamente, inicializa tu m嫭uina del tiempo!
|
||||
prueba -d .git
|
|
@ -1,51 +1,51 @@
|
|||
title = Helping each other
|
||||
cards = checkout commit-auto reset-hard pull push
|
||||
título = Ayudándose unos a otros
|
||||
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
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
echo "Acabo de despertar. Tiene hambre". > sam
|
||||
git agregar.
|
||||
git commit -m "El comienzo"
|
||||
|
||||
git checkout -b pancakes
|
||||
echo "Had blueberry pancakes with maple syrup for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Pancakes!"
|
||||
git checkout -b panqueques
|
||||
echo "Comí panqueques de arándanos con jarabe de arce para desayunar". > sam
|
||||
git agregar.
|
||||
git commit -m "¡Panqueques!"
|
||||
|
||||
git checkout -b muesli main
|
||||
echo "Had muesli with oats and strawberries for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Muesli!"
|
||||
git checkout -b muesli principal
|
||||
echo "Comí muesli con avena y fresas para desayunar." > sam
|
||||
git agregar.
|
||||
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 merge pancakes
|
||||
git merge muesli
|
||||
git pago principal
|
||||
git fusionar panqueques
|
||||
git fusionar muesli
|
||||
|
||||
echo "Had pancakes with strawberries for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Let's make this breakfast compromise" --author="Sidekick <sidekick@example.com>"
|
||||
echo "Comí panqueques con fresas para desayunar". > sam
|
||||
git agregar.
|
||||
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^)"
|
||||
|
||||
[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! :)
|
|
@ -1,33 +1,33 @@
|
|||
title = Adding a remote
|
||||
cards = checkout
|
||||
title = Agregar un control remoto
|
||||
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
|
||||
git add .
|
||||
git commit -m "Write a letter"
|
||||
echo "¡Estoy realmente comprometido con nuestra amistad! <3" > love_letter
|
||||
git agregar.
|
||||
git commit -m "Escribe una carta"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# Add a remote that points to ../friend.
|
||||
git remote -v | grep '../friend'
|
||||
# Pull from the remote.
|
||||
git show HEAD:love_letter | grep committed
|
||||
# Agrega un control remoto que apunte a ../friend.
|
||||
git remoto -v | grep '../amigo'
|
||||
# Tire del control remoto.
|
||||
git show HEAD:love_letter | grep comprometido
|
|
@ -1,23 +1,23 @@
|
|||
title = Deleting and renaming a remote
|
||||
cards = checkout
|
||||
title = Eliminar y cambiar el nombre de un control remoto
|
||||
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]`)
|
||||
git remote | grep friend
|
||||
# The remote with the typo is gone.
|
||||
! grep 'frend' <(git remote)
|
||||
# Delete the remote you don't want to keep (using `git remote remove [remote]`)
|
||||
! grep 'enemy' <(git remote)
|
||||
# Cambie el nombre del control remoto con el error tipográfico (usando `git remoto renombrar [nombre antiguo] [nombre nuevo]`)
|
||||
git remoto | gran amigo
|
||||
# El control remoto con el error tipográfico desapareció.
|
||||
! grep 'frend' <(git remoto)
|
||||
# Elimina el control remoto que no deseas conservar (usando `git remoto remove [remoto]`)
|
||||
! grep 'enemigo' <(git remoto)
|
|
@ -1,28 +1,28 @@
|
|||
title = Looking into the past
|
||||
cards = checkout-from
|
||||
título = Mirando hacia el pasado
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "Versión inicial" > ensayo.txt
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
echo "Improved version" > essay.txt
|
||||
git commit -a -m "Improved version"
|
||||
echo "Versión mejorada" > ensayo.txt
|
||||
git commit -a -m "Versión mejorada"
|
||||
|
||||
echo "Best version" > essay.txt
|
||||
git commit -a -m "Best version"
|
||||
echo "Mejor versión" > ensayo.txt
|
||||
git commit -a -m "Mejor versión"
|
||||
|
||||
echo "Less-good version" > essay.txt
|
||||
git commit -a -m "Less-good version"
|
||||
echo "Versión menos buena" > ensayo.txt
|
||||
git commit -a -m "Versión menos buena"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
# For nostalgic reasons, restore the very first backup you made!
|
||||
diff essay.txt <(echo "Best version")
|
||||
# ¡Por razones nostálgicas, restaure la primera copia de seguridad que realizó!
|
||||
diff ensayo.txt <(echo "Mejor versión")
|
|
@ -1,26 +1,26 @@
|
|||
title = Split a commit!
|
||||
cards = checkout commit reset-hard reset add rebase-interactive rebase-continue show
|
||||
title = ¡Dividir un compromiso!
|
||||
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
|
||||
echo something else > file2
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
hacer eco de algo > archivo1
|
||||
hacer eco de algo más > archivo2
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
echo this should happen first >> file1
|
||||
echo and this should happen after that >> file2
|
||||
git commit -am "Both together"
|
||||
echo esto debería suceder primero >> archivo1
|
||||
echo y esto debería suceder después de eso >> archivo2
|
||||
git commit -am "Ambos juntos"
|
||||
|
||||
echo this is some other change >> file1
|
||||
echo this is some other change >> file2
|
||||
git commit -am "Something else"
|
||||
echo este es algún otro cambio >> archivo1
|
||||
echo este es algún otro cambio >> archivo2
|
||||
git commit -am "Algo más"
|
||||
|
||||
[win]
|
||||
[ganar]
|
||||
|
||||
test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file2" &&
|
||||
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^)" = "M archivo2" &&
|
||||
prueba "$(git diff-tree --no-commit-id --name-status -r main~2)" = "M archivo1"
|
|
@ -1,23 +1,23 @@
|
|||
title = One step after another
|
||||
cards = checkout commit reset-hard add
|
||||
título = Un paso tras otro
|
||||
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
|
||||
echo something else > file2
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
hacer eco de algo > archivo1
|
||||
hacer eco de algo más > archivo2
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
echo this should happen first >> file1
|
||||
echo and this should happen after that >> file2
|
||||
echo esto debería suceder primero >> archivo1
|
||||
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" &&
|
||||
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 archivo2" &&
|
||||
prueba "$(git diff-tree --no-commit-id --name-status -r main^)" = "M archivo1"
|
|
@ -1,23 +1,23 @@
|
|||
title = Nice to meet you!
|
||||
cards = config-name config-email
|
||||
título = ¡Encantado de conocerte!
|
||||
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 user.email "your@mail.com"
|
||||
git config --global usuario.nombre Nombre
|
||||
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.
|
||||
test "$(git config user.name)" != "You"
|
||||
# Tener un nombre configurado.
|
||||
prueba "$(git config user.name)" != "Tú"
|
||||
|
||||
# Have an email address configured.
|
||||
test "$(git config user.email)" != "you@time.agency"
|
||||
# Tener una dirección de correo electrónico configurada.
|
||||
prueba "$(git config usuario.correo electrónico)" != "tú@time.agency"
|
|
@ -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
|
||||
echo important > important
|
||||
git add important
|
||||
git commit -m "Initial commit"
|
||||
toque .gitignore
|
||||
eco importante > importante
|
||||
git agregar importante
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
[actions]
|
||||
[comportamiento]
|
||||
|
||||
echo "$RANDOM" > chicken
|
||||
echo "$RANDOM" > pollo
|
|
@ -1,26 +1,26 @@
|
|||
title = Cloning a repo
|
||||
cards = clone commit-auto reset-hard checkout file-new branch
|
||||
título = Clonación de un repositorio
|
||||
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
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
eco "2 + 3 = " > archivo
|
||||
git agregar.
|
||||
git commit -m "Compromiso inicial"
|
||||
|
||||
[actions friend]
|
||||
[acciones amigo]
|
||||
|
||||
git ls-remote yours | grep pr && git fetch yours && git merge yours/solution
|
||||
git show main:file | grep 5 && hint "Thanks!"
|
||||
git ls-remoto tuyo | grep pr && git busca el tuyo && git fusiona el tuyo/solución
|
||||
git show principal:archivo | grep 5 && sugerencia "¡Gracias!"
|
||||
|
||||
[win friend]
|
||||
[gana amigo]
|
||||
|
||||
git show main:file | grep 5
|
||||
git show principal:archivo | grupo 5
|
|
@ -1 +1 @@
|
|||
pr
|
||||
pr
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue