Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions 2025-2/2025-04-07-Taller-Interno-Git/CursoGit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
lang: "es"
title: "Git para principiantes"
subtitle: "Introducción al control de versiones con git"
author:
- \textsc{LIDSoL members} \newline The GOAT lab
institute:
- \textit{Universidad Nacional Autónoma de México\\ Facultad de Ingeniería}
date: Taller de Git, Semestre 2025-2
---

# Información del Taller

## Tiempo estimado

Aproximadamente 180 minutos de taller.

## Objetivos

Que los participantes entiendan:

- Que es un sistema de control de versiones y su utilidad
- Flujo de trabajo básico con git
- Comandos básicos de git
- Uso de ramas
- Uso de repositorios remotos
- Creación de un repositorio en GitHub

# Introducción al tema

Un sistema de control de versiones es una herramienta que permite llevar un registro de los cambios realizados en un proyecto a lo largo del tiempo.

![Homework-flow](./img/Tareas.png)

# Qué es Git

- Git es un sistema de control de versiones distribuido.
- Fue creado por Linus Torvalds en 2005.
- Es software libre y de código abierto.

# Flujo de trabajo básico con Git

![Github-flow](./img/github-flow-diagram.png)

# Conceptos básicos

## Snapshot

Representa el estado de los archivos en un momento dado.

## Commit

Es un snapshot con un mensaje descriptivo.

## Branch

Es una línea de desarrollo independiente.

## Repositorio

Es un conjunto de archivos y directorios que git controla.

# Usando Git

![Zonas de trabajo](./img/basic-usage.png)

# Usando Git

![Zonas de trabajo](./img/basic-usage-2.png)

# Usando Git

![Convenciones](./img/conventions.png)

# Comandos básicos

![Commit](./img/commit-main.png)

# Comandos básicos

![Commit stable](./img/commit-stable.png)

# Comandos básicos

![Commit amend](./img/commit-amend.png)

# Comandos básicos

![Diff](./img/diff.png)

# Comandos básicos

![Checkout](./img/checkout-files.png)

# Comandos básicos

![Checkout branch](./img/checkout-branch.png)

# Comandos básicos

![Checkout detached](./img/checkout-detached.png)

# Comandos básicos

![Commit detached](./img/commit-detached.png)

# Comandos básicos

![Checkout after detached](./img/checkout-after-detached.png)

# Comandos básicos

![Checkout b detached](./img/checkout-b-detached.png)

# Comandos básicos

![Reset commit](./img/reset-commit.png)

# Comandos básicos

![Reset](./img/reset.png)

# Comandos básicos

![Reset files](./img/reset-files.png)

# Comandos básicos

![Merge Fast Forward](./img/merge-ff.png)

# Comandos básicos

![Merge](./img/merge.png)

# Comandos básicos

![Cherry pick](./img/cherry-pick.png)

# Comandos básicos

![Rebase](./img/rebase.png)

# Comandos básicos

![Rebase onto](./img/rebase-onto.png)

# Bibliografía

- https://git-scm.com/book/en/v2
- https://marklodato.github.io/visual-git-guide/index-es.html
- https://blog.kinto-technologies.com/posts/2023-03-07-From-Git-flow-to-GitHub-flow/
Binary file added 2025-2/2025-04-07-Taller-Interno-Git/CursoGit.pdf
Binary file not shown.
Binary file added 2025-2/2025-04-07-Taller-Interno-Git/guide.pdf
Binary file not shown.
104 changes: 104 additions & 0 deletions 2025-2/2025-04-07-Taller-Interno-Git/guide.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
\documentclass[12pt, letterpaper]{article}

\usepackage[english]{babel} % Sets the language and regional settings for English documents
\usepackage[utf8]{inputenc} % Allows the use of UTF-8 characters in the document
\usepackage[T1]{fontenc} % Specifies the font encoding
\usepackage[margin=2cm]{geometry} % Sets the page margins
\usepackage{makeidx} % Enables the creation of indexes
\usepackage{natbib} % Provides flexible bibliography support
\usepackage{url} % Allows the use of URLs
\usepackage{enumitem} % Customizes the appearance of lists
\usepackage{listings} % Provides syntax highlighting for code listings
\usepackage[dvipsnames]{xcolor} % Allows the use of colors
\usepackage{parskip} % Modifies paragraph spacing
\usepackage{graphicx} % Enables the inclusion of graphics
\usepackage{tikz} % Allows the creation of graphics and diagrams
\usepackage{float}
\usepackage{hyperref} % Enables the creation of hyperlinks
\usepackage{amsmath} % Provides additional math environments and commands
\usepackage{circuitikz} % Allows the creation of electrical circuits
\usepackage{adjustbox} % Adjusts the size of the circuit diagrams
\usepackage{arydshln} % Allows the use of dashed lines in tables

\usetikzlibrary{shapes.geometric, positioning}

\lstset{
language=SQL,
basicstyle=\ttfamily\small,
keywordstyle=\color{blue},
commentstyle=\color[rgb]{0,0.5,0},
stringstyle=\color{red},
numbers=left,
numberstyle=\tiny\color{gray},
stepnumber=1,
numbersep=10pt,
backgroundcolor=\color{white},
showspaces=false,
showstringspaces=false,
breaklines=true,
frame=single,
tabsize=2, captionpos=b, lineskip=-1pt,
extendedchars=true,
literate={á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{\textquestiondown}}1 {¡}{{\textexclamdown}}1
}

\graphicspath{ {./img/} } % Sets the path for the graphics

\newlist{biblio}{enumerate}{1}
\setlist[biblio,1]{label=[\arabic*]}

\makeindex

\begin{document}

\section*{Sistema de control de versiones}

\subsection*{¿Qué es un sistema de control de versiones?}

Un sistema de control de versiones (VCS) es una herramienta que permite gestionar y realizar un seguimiento de los cambios en archivos y proyectos a lo largo del tiempo. Facilita mucho colaboración entre múltiples desarrolladores, permitiendo que trabajen en el mismo proyecto sin conflictos. Sirven para el desarrollo de software, ya que permiten revertir cambios, comparar versiones y mantener un historial completo de modificaciones.

Justo en este curso lo que buscamos en entender como funcionan estos sistemas, pero, con git.

\subsection*{¿Qué es Git?}
Git es un sistema de control de versiones distribuido, lo que significa que cada desarrollador tiene una copia completa del repositorio en su máquina local.

Esto permite trabajar sin conexión y realizar cambios de manera independiente antes de sincronizar con el repositorio central.

Git es ampliamente utilizado en el desarrollo de software debido a su eficiencia, flexibilidad y capacidad para manejar proyectos grandes y complejos.

Y lo más importante, es software libre y de código abierto.

\section*{Conceptos básicos de Git}

\subsection*{Snapshot}
Un snapshot en Git es una captura del estado actual de los archivos en un repositorio en un momento específico. Cada vez que realizamos un commit, Git guarda un snapshot de cómo lucen todos los archivos en ese momento.

\subsection*{Commit}
Un commit es un registro de los cambios realizados en el repositorio. Cada commit tiene un identificador único (hash) y contiene información sobre los cambios realizados, el autor y la fecha. Los commits permiten rastrear el historial del proyecto y revertir a versiones anteriores si es necesario.

\subsection*{Branch}
Una branch o rama es una línea de desarrollo independiente dentro de un repositorio. Permite trabajar en diferentes características o correcciones de errores sin afectar la rama principal. Este concepto es principalmente usado para desarrollo colaborativo.

\subsection*{Repositorio}
Un repositorio es un espacio de almacenamiento donde se guardan todos los archivos y el historial de cambios de un proyecto. Puede ser local (en la máquina del desarrollador) o remoto (en un servidor, como gitlab o github). Git permite clonar, crear y gestionar repositorios de manera eficiente.

\subsection*{Cherry-pick}
El cherry-pick es una operación en Git que permite aplicar un commit específico de una rama a otra. Esto es útil cuando se desea incorporar un cambio particular sin fusionar toda la rama. Al hacer cherry-pick, Git crea un nuevo commit en la rama de destino con los cambios del commit seleccionado.

\subsection*{Rebase}
El rebase es una operación en Git que permite mover o combinar commits de una rama a otra. A diferencia del merge, que crea un nuevo commit de fusión, el rebase reescribe el historial de commits, aplicando los cambios de una rama sobre otra.

\subsection*{Rebase onto}
git rebase --onto es una variante del rebase que permite especificar una nueva base para una serie de commits. Es similar a un cherry pick, pero en lugar de aplicar un solo commit, se pueden mover varios commits a una nueva.


% \section{Bibliography}

% \begin{biblio}
% %for: https://www.poli.edu.co/blog/poliverso/diseno-digital-que-es
% \item \textit{Diseño digital: qué es y por qué es importante.} (2021, August 26). Poliverso. Retrieved October 16, 2024, from: \textcolor{blue}{\underline{\url{https://www.poli.edu.co/blog/poliverso/diseno-digital-que-es}}}
% %for: https://www.sky6cancun.com/marketing/diseno-grafico/diseno-digital-que-es-y-para-que-sirve/
% \item \textit{Diseño digital: qué es y para qué sirve.} (2021, August 26). Sky6Cancún. Retrieved October 16, 2024, from: \textcolor{blue}{\underline{\url{https://www.sky6cancun.com/marketing/diseno-grafico/}}}
% \end{biblio}

\end{document}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2025-2/2025-04-07-Taller-Interno-Git/img/diff.png
62 changes: 62 additions & 0 deletions 2025-2/2025-04-07-Taller-Interno-Git/preamble.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{charter}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{listings}
\usefonttheme[onlymath]{serif}

\definecolor{azuloscuro}{HTML}{152139}
\definecolor{azulclaro}{HTML}{0064FF}

\setbeamerfont{subtitle}{size=\scriptsize}
\setbeamertemplate{title page}{
\begin{tikzpicture}[remember picture, overlay]
\fill[azuloscuro] (current page.south west) rectangle (current page.north east);
\draw[azulclaro, line width=1ex] (current page.north west) -- (current page.north east);
\node[anchor=center, align=left, text width=\textwidth, inner sep=0pt, text=white, text height=2.5ex] at (current page.center) {
\usebeamerfont{title}
{\centering\inserttitle\\[1cm]}
\rule{\linewidth}{0.4pt}
\usebeamerfont{subtitle}
{\insertauthor\\[0.2cm]}
{\insertinstitute\par}
\rule{\linewidth}{0.4pt}\\[0.5cm]
{\insertdate}
};
\end{tikzpicture}
}


\setbeamertemplate{headline}{%
{\color{azulclaro}\rule{\paperwidth}{1ex}}%
}

\setbeamercolor*{titlelike}{use=structure, fg=azuloscuro, bg=white}

\setbeamercolor*{footline in head/foot}{use=structure, fg=white, bg=azuloscuro}
\setbeamertemplate{footline}{%
\usebeamertemplate*{headline}
\begin{beamercolorbox}[ht=8.25ex, dp=1ex]{footline in head/foot}
\hspace{1.2em}\includegraphics[height=.25in]{img/lidsol-small.png}\quad
\hspace{1.2em}\includegraphics[height=.25in]{img/die-small.png}\quad
\hspace{1.2em}\includegraphics[height=.25in]{img/fi-small.png}\quad
\hfill
\vbox{%
\hbox{\hspace{.65in}\fontfamily{phv}\selectfont\textbf{LIDSOL} cursos}%
\par
\hbox{
\usebeamertemplate***{navigation symbols}
}
}
\hspace{.5em}
\end{beamercolorbox}%
}

\setbeamercolor{itemize item}{fg=azulclaro}
\setbeamercolor{itemize subitem}{fg=azulclaro}
\setbeamercolor{itemize subsubitem}{fg=azulclaro}

\setbeamertemplate{navigation symbols}{}