<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: David Rojo</title>
    <description>The latest articles on Forem by David Rojo (@davidrojom).</description>
    <link>https://forem.com/davidrojom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F749997%2Fa7aab1bf-acc9-4ddb-a0b5-18eaba18ed9d.jpeg</url>
      <title>Forem: David Rojo</title>
      <link>https://forem.com/davidrojom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/davidrojom"/>
    <language>en</language>
    <item>
      <title>[EN] Git. Guide from scratch</title>
      <dc:creator>David Rojo</dc:creator>
      <pubDate>Mon, 07 Nov 2022 17:14:19 +0000</pubDate>
      <link>https://forem.com/davidrojom/en-git-guide-from-scratch-ao4</link>
      <guid>https://forem.com/davidrojom/en-git-guide-from-scratch-ao4</guid>
      <description>&lt;p&gt;In this article we will cover everything from creating a new repository to publishing it on a server and some commands that I use on a daily basis that may be useful.&lt;/p&gt;

&lt;p&gt;Installed Git is a must.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. ¿What is Git?
&lt;/h2&gt;

&lt;p&gt;Git is the most widely used version control system in use nowadays, it has become the de facto standard for most companies, so it is important to know how to manage it efficiently.&lt;/p&gt;

&lt;p&gt;A versioned project in Git is composed of a minimum of four &lt;em&gt;areas&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Working Area&lt;/em&gt;&lt;/strong&gt;: contains files that have been created, modified or deleted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Stash Area&lt;/em&gt;&lt;/strong&gt;: files that have been modified and we've set aside to do something with them in the future.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Staging Area&lt;/em&gt;&lt;/strong&gt;: contains the files that we want to be added to the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Local Repository&lt;/em&gt;&lt;/strong&gt;: This is the modification history of our repository, it is made up of different branches that contain all the changes that have been made to a project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The branches are copies of the project starting from the same codebase, their function is to implement changes to our repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additionally, we can have one more area, called &lt;strong&gt;&lt;em&gt;Remote repository&lt;/em&gt;&lt;/strong&gt;, which is nothing more than a copy of our &lt;strong&gt;&lt;em&gt;Local Repository&lt;/em&gt;&lt;/strong&gt; area, located in one or more servers, be it &lt;a href="https://github.com"&gt;GitHub&lt;/a&gt;, &lt;a href="https://gitlab.com"&gt;GitLab&lt;/a&gt; or &lt;a href="https://bitbucket.org"&gt;BitBucket&lt;/a&gt; among others...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is possible to have more than one &lt;em&gt;Remote Repository&lt;/em&gt; for a single &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Initial configuration.
&lt;/h2&gt;

&lt;p&gt;The first thing we have to do after installing Git is to configure our credentials, for this we are going to make use of these three commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"your_username"&lt;/span&gt; 
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your_email"&lt;/span&gt; 
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor &lt;span class="s2"&gt;"your_text_editor"&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Vim is the default text editor.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Initialising/Downloading a repository.
&lt;/h2&gt;

&lt;p&gt;To start a repository we just need to run the &lt;code&gt;git init&lt;/code&gt; command inside our project directory.&lt;/p&gt;

&lt;p&gt;To download (clone) an existing repository, we must execute the command &lt;code&gt;git clone &amp;lt;url_repository&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common commands.
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of the commands contain extra parameters that for simplicity will not be explained in this article. The most common ones for everyday use will be explained.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4.1. Files.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to move files from &lt;em&gt;Working directory&lt;/em&gt; to &lt;em&gt;Staging Area&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash&lt;/code&gt;&lt;/strong&gt;: allows us to reserve changes from our &lt;em&gt;Staging Area&lt;/em&gt; for later use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash list&lt;/code&gt;&lt;/strong&gt; : allows us to list the changes we have previously stashed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash pop&lt;/code&gt;&lt;/strong&gt; : allows us to retrieve the last change we saved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash pop &amp;lt;index_stash&amp;gt;&lt;/code&gt;&lt;/strong&gt;: retrieve the change with a given index .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash drop&lt;/code&gt;&lt;/strong&gt; : allows us to delete a change we have reserved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git commit -m "message"&lt;/code&gt;&lt;/strong&gt;: allows us to move files from &lt;em&gt;Staging Area&lt;/em&gt; to &lt;em&gt;Local Repository&lt;/em&gt; by adding a message.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git diff &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/strong&gt;:shows the difference in a file from its previous version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset&lt;/code&gt;&lt;/strong&gt;: allows us to move all files from &lt;em&gt;Staging Area&lt;/em&gt; to &lt;em&gt;Working Directory&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to move a file from the &lt;em&gt;Staging Area&lt;/em&gt; to the &lt;em&gt;Working Directory&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset --soft HEAD~&amp;lt;commits_number&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to undo changes to our &lt;em&gt;Local Repository&lt;/em&gt; x &lt;code&gt;commits&lt;/code&gt; backwards without losing those modifications, where x=&amp;lt;commits_number&amp;gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git restore &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to undo changes that have been made to a file.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.2. Branches.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/strong&gt;: lists all the branches in our &lt;em&gt;Local Repository&lt;/em&gt; and which one we are currently on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch -d&lt;/code&gt;&lt;/strong&gt;: remove a branch that has already been merged into another branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch -D&lt;/code&gt;&lt;/strong&gt;:forces the removal of a branch, whether it has already been merged or not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git switch &amp;lt;destination_branch_name&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to switch to the destination branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git switch -c &amp;lt;branch_name&amp;gt;&lt;/code&gt;&lt;/strong&gt;: create a new branch from the branch we are currently on and move to it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git checkout &amp;lt;id_commit&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to move to an existing commit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git merge &amp;lt;branch_to_merge&amp;gt;&lt;/code&gt;&lt;/strong&gt;: merge a branch into our current branch.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.3. Remote Repository.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote add &amp;lt;link_name&amp;gt; &amp;lt;url_repository&amp;gt;&lt;/code&gt;&lt;/strong&gt;: links our &lt;em&gt;Local Repository&lt;/em&gt; to a &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote remove &amp;lt;link_name&amp;gt;&lt;/code&gt;&lt;/strong&gt;: delete a link to a &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote -v&lt;/code&gt;&lt;/strong&gt;: lists which &lt;em&gt;Remote Repositories&lt;/em&gt; our &lt;em&gt;Local Repository&lt;/em&gt; is linked to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push &amp;lt;link_name&amp;gt; &amp;lt;remote_branch&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to upload commits from our &lt;em&gt;Local Repository&lt;/em&gt; to a &lt;em&gt;Remote&lt;br&gt;
Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push -f &amp;lt;link_name&amp;gt; &amp;lt;remote_branch&amp;gt;&lt;/code&gt;&lt;/strong&gt;: allows us to force the upload of commits from our &lt;em&gt;Local Repository&lt;/em&gt; to a &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git fetch&lt;/code&gt;&lt;/strong&gt;: download metadata from a &lt;em&gt;Remote Repository&lt;/em&gt; to a &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/strong&gt;: is a combination of &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git merge&lt;/code&gt;, it pulls the changes and metadata from a &lt;em&gt;Remote Repository&lt;/em&gt; and merges them with our current branch in &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.4. Generic.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/strong&gt;: shows the current status of our repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git log&lt;/code&gt;&lt;/strong&gt;: lists the changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you know of a useful command that you think should be on this list, don't hesitate to comment!&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>[ES] Git. Guía desde cero.</title>
      <dc:creator>David Rojo</dc:creator>
      <pubDate>Sun, 06 Nov 2022 23:45:00 +0000</pubDate>
      <link>https://forem.com/davidrojom/es-git-guia-desde-cero-2jln</link>
      <guid>https://forem.com/davidrojom/es-git-guia-desde-cero-2jln</guid>
      <description>&lt;p&gt;En este artículo veremos desde la creación de un nuevo repositorio hasta la publicación de este en un servidor y comandos que uso a diario que pueden resultar útiles.&lt;/p&gt;

&lt;p&gt;Será necesario tener Git instalado en nuestro equipo.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. ¿Qué es Git?
&lt;/h2&gt;

&lt;p&gt;Git es el sistema de control de versiones más usado actualmente, se ha convertido en el estándar de facto para la mayoría de las empresas, por eso es importante saber cómo manejarlo eficientemente.&lt;/p&gt;

&lt;p&gt;Un proyecto versionado en Git, está compuesto por un mínimo de cuatro &lt;em&gt;áreas&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Working Area&lt;/em&gt;&lt;/strong&gt;: comprende los ficheros que han sido creados, modificados o borrados.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Stash&lt;/em&gt;&lt;/strong&gt;: comprende los ficheros que han sido modificados y hemos reservado para hacer algo con ellos en un futuro.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Staging Area&lt;/em&gt;&lt;/strong&gt;: comprende los ficheros que queremos que sean añadidos al repositorio.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Local Repository&lt;/em&gt;&lt;/strong&gt;: Es el historico de modificaciones de nuesto repositorio, esta compuesto por diferentes &lt;strong&gt;ramas&lt;/strong&gt; que contienen todos los cambios que se han realizado sobre un proyecto.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Las ramas son copias del proyecto que parten de la misma base de código, utilizadas para implementar cambios a nuestro repositorio.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Adicionalmente, podemos tener un área más, llamada &lt;strong&gt;&lt;em&gt;Remote repository&lt;/em&gt;&lt;/strong&gt;, que no es más que una copia de nuestra área &lt;strong&gt;&lt;em&gt;Local Repository&lt;/em&gt;&lt;/strong&gt;, localizada en uno o varios servidores, ya sean &lt;a href="https://github.com"&gt;GitHub&lt;/a&gt;, &lt;a href="https://gitlab.com"&gt;GitLab&lt;/a&gt; o &lt;a href="https://bitbucket.org"&gt;BitBucket&lt;/a&gt; entre otros...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Es posible tener más de un &lt;em&gt;Remote Repository&lt;/em&gt; para un &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Configuración inicial.
&lt;/h2&gt;

&lt;p&gt;Lo primero que tenemos que hacer tras instalar Git es configurar nuestras credenciales, para esto vamos a hacer uso de estos tres comandos.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"tu_nombre_de_usuario"&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"tu_email"&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor &lt;span class="s2"&gt;"tu_editor_de_texto"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;El editor de texto por defecto es Vim.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Iniciar/Descargar un repositorio.
&lt;/h2&gt;

&lt;p&gt;Para iniciar un repositorio solo tenemos que ejecutar el comando &lt;code&gt;git init&lt;/code&gt; dentro del directorio de nuestro proyecto.&lt;/p&gt;

&lt;p&gt;Para descargar(clonar) un repositorio ya existente, debemos ejecutar el comando &lt;code&gt;git clone &amp;lt;url_repositorio&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Comandos comunes.
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;La mayoría de los comandos contienen parámetros extra que por simplicidad no serán explicados en este artículo. Serán explicados los más comunes para un uso cotidiano.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4.1. Ficheros.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add &amp;lt;fichero&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite mover ficheros desde &lt;em&gt;Working directory&lt;/em&gt; a &lt;em&gt;Staging Area&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash&lt;/code&gt;&lt;/strong&gt;: nos permite reservar los cambios de nuestro &lt;em&gt;Staging Área&lt;/em&gt; para ser usados posteriormente.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash list&lt;/code&gt;&lt;/strong&gt; : nos permite listar los cambios que hemos reservado con anterioridad.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash pop&lt;/code&gt;&lt;/strong&gt;: nos permite recuperar el último cambio que hemos guardado.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash pop &amp;lt;índice_stash&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite recuperar el cambio con índice &amp;lt;índice_stash&amp;gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git stash drop&lt;/code&gt;&lt;/strong&gt; : nos permite borrar un cambio que hemos reservado.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git commit -m "mensaje"&lt;/code&gt;&lt;/strong&gt;: nos permite mover ficheros desde &lt;em&gt;Staging Area&lt;/em&gt; a &lt;em&gt;Local Repository&lt;/em&gt; añadiendo un mensaje.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git diff &amp;lt;nombre_fichero&amp;gt;&lt;/code&gt;&lt;/strong&gt;:muestra la diferencia sobre un fichero con respecto a su anterior versión.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset&lt;/code&gt;&lt;/strong&gt;: nos permite mover todos los ficheros desde &lt;em&gt;Staging Area&lt;/em&gt; a &lt;em&gt;Working Directory&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset &amp;lt;nombre_fichero&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite mover un fichero desde &lt;em&gt;Staging Area&lt;/em&gt; a &lt;em&gt;Working Directory&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset --soft HEAD~&amp;lt;numero_de_commits&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite deshacer los cambios de nuestro &lt;em&gt;Local Repository&lt;/em&gt; x &lt;code&gt;commits&lt;/code&gt; hacia atrás sin perder esas modificaciones, donde x=&amp;lt;numero_de_commits&amp;gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git restore &amp;lt;nombre_fichero&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite deshacer los cambios que se han realizado sobre un fichero.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.2. Ramas.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/strong&gt;: lista todas las ramas de nuestro &lt;em&gt;Local Repository&lt;/em&gt; y en cuál estamos actualmente.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch -d&lt;/code&gt;&lt;/strong&gt;: elimina una rama que ya ha sido fusionada con otra.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch -D&lt;/code&gt;&lt;/strong&gt;:fuerza la eliminación de una rama, haya sido ya fusionada o no.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git switch &amp;lt;nombre_rama_destino&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite cambiarnos a la rama destino.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git switch -c &amp;lt;nombre_rama&amp;gt;&lt;/code&gt;&lt;/strong&gt;: crea una nueva rama a partir de la rama en la que nos encontramos actualmente y nos movemos a esta.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git checkout &amp;lt;id_commit&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite movernos hacia un commit existente.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git merge &amp;lt;rama_a_fusionar&amp;gt;&lt;/code&gt;&lt;/strong&gt;: fusiona una rama con nuestra rama actual.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.3. Repositorio Remoto.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote add &amp;lt;nombre_vinculo&amp;gt; &amp;lt;url_repositorio&amp;gt;&lt;/code&gt;&lt;/strong&gt;: vincula nuestro &lt;em&gt;Local Repository&lt;/em&gt; con un &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote remove &amp;lt;nombre_vinculo&amp;gt;&lt;/code&gt;&lt;/strong&gt;: borra un vínculo con un &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote -v&lt;/code&gt;&lt;/strong&gt;:lista con que &lt;em&gt;Remote Repositories&lt;/em&gt; está vinculado nuestro &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push &amp;lt;nombre_vínculo&amp;gt; &amp;lt;rama_remota&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite subir los commits de nuestro &lt;em&gt;Local Repository&lt;/em&gt; a un &lt;em&gt;Remote &lt;br&gt;
Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push -f &amp;lt;nombre_vínculo&amp;gt; &amp;lt;rama_remota&amp;gt;&lt;/code&gt;&lt;/strong&gt;: nos permite forzar la subida de los commits de nuestro &lt;em&gt;Local Repository&lt;/em&gt; a un &lt;em&gt;Remote Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git fetch&lt;/code&gt;&lt;/strong&gt;: descarga los metadatos de un &lt;em&gt;Remote Repository&lt;/em&gt; a un &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/strong&gt;: es una combinación de &lt;code&gt;git fetch&lt;/code&gt; y &lt;code&gt;git merge&lt;/code&gt;, descarga los cambios y metadatos de un &lt;em&gt;Remote Repository&lt;/em&gt; y los fusiona con nuestra rama actual en &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.4. Genéricos.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/strong&gt;: muestra el estado actual de nuestro repositorio.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git log&lt;/code&gt;&lt;/strong&gt;: lista los cambios que se han realizado en nuestro &lt;em&gt;Local Repository&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Si conoces algún comando útil y crees que debería estar en esta lista, no dudes en comentarlo!&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>spanish</category>
    </item>
  </channel>
</rss>
