Commit 4663295e authored by Fedrico Otaran's avatar Fedrico Otaran
Browse files

Refactor del código de la guía de git

parent 001bde4d
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "decimal-montreal",
"id": "secure-kenya",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -19,7 +19,7 @@
},
{
"cell_type": "markdown",
"id": "adequate-summary",
"id": "focused-revolution",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -37,7 +37,7 @@
},
{
"cell_type": "markdown",
"id": "therapeutic-somalia",
"id": "grand-lloyd",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -49,7 +49,7 @@
},
{
"cell_type": "markdown",
"id": "outdoor-excellence",
"id": "prepared-intermediate",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -63,7 +63,7 @@
},
{
"cell_type": "markdown",
"id": "sexual-assessment",
"id": "meaningful-greek",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -75,7 +75,7 @@
},
{
"cell_type": "markdown",
"id": "tamil-impact",
"id": "meaning-worship",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -88,7 +88,7 @@
},
{
"cell_type": "markdown",
"id": "grateful-negative",
"id": "metallic-tunnel",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -101,7 +101,7 @@
},
{
"cell_type": "markdown",
"id": "dedicated-hungarian",
"id": "equipped-stroke",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -114,7 +114,7 @@
},
{
"cell_type": "markdown",
"id": "cheap-resolution",
"id": "renewable-password",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -127,7 +127,7 @@
},
{
"cell_type": "markdown",
"id": "dental-baseline",
"id": "entire-preservation",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -140,7 +140,7 @@
},
{
"cell_type": "markdown",
"id": "tight-automation",
"id": "flush-blowing",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -152,7 +152,7 @@
},
{
"cell_type": "markdown",
"id": "grave-webster",
"id": "prospective-channel",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -164,7 +164,7 @@
},
{
"cell_type": "markdown",
"id": "consolidated-convention",
"id": "pending-handbook",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -179,7 +179,7 @@
},
{
"cell_type": "markdown",
"id": "secret-assumption",
"id": "faced-soccer",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -191,7 +191,7 @@
},
{
"cell_type": "markdown",
"id": "crucial-crisis",
"id": "equipped-running",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -203,7 +203,7 @@
},
{
"cell_type": "markdown",
"id": "hourly-scope",
"id": "social-breeding",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -217,7 +217,7 @@
},
{
"cell_type": "markdown",
"id": "historic-medline",
"id": "ordinary-terrain",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -241,7 +241,7 @@
},
{
"cell_type": "markdown",
"id": "built-liberia",
"id": "widespread-clarity",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -262,7 +262,7 @@
},
{
"cell_type": "markdown",
"id": "encouraging-franklin",
"id": "alpine-location",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -276,7 +276,7 @@
},
{
"cell_type": "markdown",
"id": "grave-bachelor",
"id": "spoken-router",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -293,7 +293,7 @@
},
{
"cell_type": "markdown",
"id": "boolean-lexington",
"id": "sharp-ordinary",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -306,17 +306,21 @@
"\n",
"En git cuando se va a realizar una operación para generar una nueva versión del código es necesario contar con información de usuario. Por esto es necesario que configuremos lo siguiente:\n",
"\n",
"`$ git config --global user.name \"John Doe\"`\n",
"`$ git config --global user.email johndoe@example.com`\n",
"```bash\n",
"$ git config --global user.name \"John Doe\"\n",
"$ git config --global user.email johndoe@example.com\n",
"```\n",
"\n",
"Para ver la configuración:\n",
"\n",
"`$ git config --list`"
"```bash\n",
"$ git config --list\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "comparative-calcium",
"id": "entitled-entrepreneur",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -330,7 +334,7 @@
},
{
"cell_type": "markdown",
"id": "subject-belly",
"id": "governing-syria",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -339,17 +343,20 @@
"source": [
"Crear un repositorio local con Git en tu máquina dentro de un directorio llamado `ejemplo_python`. \n",
"\n",
"`$ mkdir ejemplo_python`\n",
"```bash\n",
"$ mkdir ejemplo_python\n",
"```\n",
"\n",
"Movete dentro de este directorio.\n",
"\n",
"`$ cd ejemplo_python`\n",
" "
"```bash\n",
"$ cd ejemplo_python\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "consolidated-perry",
"id": "macro-maine",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -358,9 +365,11 @@
"source": [
"\n",
"\n",
" Ahora vamos a inicializar nuestro directorio como un directorio versionado por Git\n",
" \n",
" `$ git init`\n",
"Ahora vamos a inicializar nuestro directorio como un directorio versionado por Git\n",
"\n",
"```bash\n",
"$ git init\n",
"```\n",
" \n",
"![Imgur](https://i.imgur.com/rLZ8qyD.png)\n",
"\n",
......@@ -369,23 +378,25 @@
},
{
"cell_type": "markdown",
"id": "ahead-billion",
"id": "loving-liquid",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
" Ya estamos listos para crear nuestro primer archivo.\n",
" \n",
" `vim app.py`\n",
"Ya estamos listos para crear nuestro primer archivo.\n",
"\n",
"```bash\n",
"$ vim app.py\n",
"```\n",
" \n",
"Guardamos el archivo en el directorio de nuestro proyecto."
]
},
{
"cell_type": "markdown",
"id": "advance-congress",
"id": "painful-jordan",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -402,7 +413,7 @@
},
{
"cell_type": "markdown",
"id": "swiss-climate",
"id": "alive-fifteen",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -411,7 +422,7 @@
"source": [
"Para agregar este archivo al versionado de Git debemos hacer:\n",
"\n",
"```\n",
"```bash\n",
"$ git add app.py\n",
"```\n",
"\n",
......@@ -424,7 +435,7 @@
},
{
"cell_type": "markdown",
"id": "ranging-denver",
"id": "robust-transcript",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -440,7 +451,7 @@
},
{
"cell_type": "markdown",
"id": "upper-advocacy",
"id": "great-capital",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -453,7 +464,7 @@
},
{
"cell_type": "markdown",
"id": "hollywood-means",
"id": "binding-genius",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -468,7 +479,7 @@
},
{
"cell_type": "markdown",
"id": "altered-cooking",
"id": "contrary-confidence",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -482,7 +493,7 @@
},
{
"cell_type": "markdown",
"id": "chief-pattern",
"id": "numerical-saying",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -499,7 +510,7 @@
},
{
"cell_type": "markdown",
"id": "ceramic-theta",
"id": "balanced-proposition",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -511,7 +522,7 @@
},
{
"cell_type": "markdown",
"id": "bizarre-message",
"id": "touched-black",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -527,7 +538,7 @@
},
{
"cell_type": "markdown",
"id": "desirable-spectrum",
"id": "joint-concrete",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -536,14 +547,16 @@
"source": [
"Una vez creado el repositorio en `Github` tenemos que agregar ese repositorio remoto en nuestro repositorio `Git` local.\n",
"\n",
"`git remote add origin git@github.com:fedeotaran/ejemplo_python.git`\n",
"```bash\n",
"$ git remote add origin git@github.com:fedeotaran/ejemplo_python.git\n",
"```\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "built-folks",
"id": "general-terminal",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -552,9 +565,9 @@
"source": [
"Ahora ya estamos listos para subir los commits con nuestros cambios.\n",
"\n",
"`\n",
"git push -u origin master\n",
"`\n",
"```bash\n",
"$ git push -u origin master\n",
"```\n",
"\n",
"La salida de comando debería ser parecida a esta:\n",
"\n",
......@@ -563,7 +576,7 @@
},
{
"cell_type": "markdown",
"id": "wrapped-launch",
"id": "twelve-anthropology",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -576,7 +589,7 @@
},
{
"cell_type": "markdown",
"id": "lightweight-aluminum",
"id": "bulgarian-poetry",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -588,7 +601,7 @@
},
{
"cell_type": "markdown",
"id": "expired-barbados",
"id": "bulgarian-breed",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -599,18 +612,22 @@
"\n",
"Para esto es necesario usar el comando git clone.\n",
"\n",
"`git clone https://github.com/<username>/<reponame>.git`\n",
"```bash\n",
"$ git clone https://github.com/<username>/<reponame>.git\n",
"```\n",
"\n",
"En mi caso para el repositorio que acabo de crear sería:\n",
"\n",
"`git clone https://github.com/fedeotaran/ejemplo_python.git`\n",
"```bash\n",
"$ git clone https://github.com/fedeotaran/ejemplo_python.git\n",
"```\n",
"\n",
"Esto va a generar una nueva carpeta donde descargará el contenido del repositorio. La carpeta se creará en el directorio en donde estemos parados a la hora de ejecutar el comando `git clone`.\n"
]
},
{
"cell_type": "markdown",
"id": "finite-situation",
"id": "extra-effectiveness",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -623,7 +640,9 @@
"\n",
"Si queremos que la carpeta que genere sea con otro nombre distinta a la del repositorio hacemos:\n",
"\n",
"`git clone https://github.com/fedeotaran/ejemplo_python.git otro_nombre`\n",
"```bash\n",
"$ git clone https://github.com/fedeotaran/ejemplo_python.git otro_nombre\n",
"```\n",
"\n",
"El repositorio desgargado ya tiene toda la información de Git para comenzar. No es necesario hacer el git init dado que el repositorio ya creó otra persona.\n",
"\n"
......@@ -631,7 +650,7 @@
},
{
"cell_type": "markdown",
"id": "robust-forestry",
"id": "approved-commonwealth",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -640,17 +659,21 @@
"source": [
"Ya estamos listos para comenzar a trabajar o continuar el trabajo. Nos movemos dentro del directorio.\n",
"\n",
"`cd ejemplo_python`\n",
"```bash\n",
"$ cd ejemplo_python\n",
"```\n",
"\n",
"Vamos a modificar el archivo app.py que generamos anteriormente.\n",
"\n",
"`vi app.py`\n",
"```bash\n",
"$ vi app.py\n",
"```\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "guided-israel",
"id": "latter-norfolk",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -661,14 +684,16 @@
"\n",
"Y además vamos a crear un nuevo archivo `README.md` para agregarle documentación a nuestro proyecto.\n",
"\n",
"`vi README.md`\n",
"```bash\n",
"$ vi README.md\n",
"```\n",
"\n",
"<img src=\"https://i.imgur.com/uuvR3Ug.png\" title=\"source: imgur.com\" />"
]
},
{
"cell_type": "markdown",
"id": "dried-lawsuit",
"id": "allied-slave",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -682,13 +707,15 @@
"\n",
"Para sumar estos cambios a git ejecutamos `git add`.\n",
"\n",
"`git add .`\n",
"```bash\n",
"$ git add .\n",
"```\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "affected-shoulder",
"id": "contrary-vault",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -701,12 +728,14 @@
"\n",
"* Una vez que tenemos listos el grupo de cambios y queremos versionarlos creamos un nuevo commit.\n",
"\n",
"`git commit -m \"Modifico app y creación de README para documentación\"`\n"
"```bash\n",
"$ git commit -m \"Modifico app y creación de README para documentación\"\n",
"```\n"
]
},
{
"cell_type": "markdown",
"id": "seventh-encounter",
"id": "responsible-costs",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -716,14 +745,16 @@
"\n",
"Ahora vamos a subir nuestros cambios.\n",
"\n",
"`git push origin master`\n",
"```bash\n",
"$ git push origin master\n",
"```\n",
"\n",
"<img src=\"https://i.imgur.com/8AUZ8Hc.png\" title=\"source: imgur.com\" />"
]
},
{
"cell_type": "markdown",
"id": "compact-johnston",
"id": "confused-compilation",
"metadata": {},
"source": [
"### Info\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment