Skip to content

elarreglador/cheatsheet_github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 

Repository files navigation

Banner

PLANTILLA COMITS

COMMITS COMUNES
🎉 Primer commit! 🎉 Compila sin errores!! 🐞 Bug corregido:
💾 Almacenamiento: 🔗 Navegación a pantallas: 🔥 Borrado:
🚀 Cambio mayor: ✨ Cambio menor: 🎨 Mejora estética:
📜 Nueva(s) clase(s): ⚙️ Nueva(s) función(es): 🔗 Nuevo(s) API REST endpoint(s):
💡 Nueva funcionalidad: 🈯 Config. de proyecto: 🧯 Gestión de excepciones:
🔍 Tests de funcionamiento: 📷 Multimedia: 📱 pantalla/vista/pagina:
📡 Comunic.: 🌐 Network: 〰️ Data flow:
⚡Eventos: 🛡️ Seguridad:
HERRAMIENTAS EXTERNAS
🟠 Postman export: 🔴 Node-red export: 📋 TODO:
ARCHIVOS
🔤 Cambio de nombre: 📂 Estructura de archivos:
DOCUMENTACION Y REVISION
📚 Documentación: 📐 Formato y limpieza del documento: 📐 Formato y limpieza del código:
📑 Recursos: 🏗️ Arquitectura: 📸 Screenshots:
🔖 Nueva version:

AGREGA ANOTACION DE VERSION AL ULTIMO COMMIT

VERSION="v0.1.0"; git tag -a $VERSION -m " $VERSION 🔖" && git push origin $VERSION

VERSIONADO: vX.Y.Z🔖

Cada número tiene un propósito específico:

Major (X) – Cambios incompatibles: Se incrementa cuando haces cambios que rompen compatibilidad con versiones anteriores.

Minor (Y) – Nuevas funcionalidades compatibles: Se incrementa cuando agregas nuevas funciones o mejoras, pero sin romper lo que ya existía.

Patch (Z) – Corrección de errores o mejoras menores:Se incrementa cuando haces correcciones, mejoras internas o ajustes, pero sin agregar ni quitar funcionalidades públicas.

CREAR RAMA PARA FUNCIONALIDAD / CERRAR RAMA PARA FUNCIONALIDAD

Crear nueva rama de tipo feature/XXX , hotfix/XXX , fix/XXX , etc...

echo " " >> ./README.md ; git add . ; git commit -m "(⎇) Previo feature/XXX" ; git push
git checkout -b feature/XXX
echo " " >> ./README.md ; git add . ; git commit -m "(⎇) Inicio feature/XXX" ; git push

al finalizar la tarea volvemos a integrar la rama

echo " " >> ./README.md ; git add . ; git commit -m "(⎇) Previo a merge de feature/XXX"
git checkout main #Regresamos a la rama main
git pull origin main #Actualizamos main
git merge feature/XXX
echo " " >> ./README.md ; git add . ; git commit -m "(⎇) Finalizado merge feature/XXX"

Opcionalmente podemos borrar la rama de feature en local y remoto

git branch -d feature/tu-nombre-de-rama
git push origin --delete feature/tu-nombre-de-rama

DESHACER COMMIT CONSERVANDO CAMBIOS

git reset --soft HEAD~1  # Revierte el commit pero conserva los archivos
git push origin main --force # Reemplaza el commit remoto
git push origin feature/XXX --force-with-lease # Sincroniza rama remota con la local

AGREGAR CAMBIOS AL ULTIMO COMMIT

git add . ; git commit --amend --no-edit ; git push --force

GIT LOG PERSONALIZADO

nano ~/.bashrc

    # Git log personalizado
    alias git-log="git log --graph --all --decorate --pretty=format:'%C(auto)%h%Creset %C(green)[%an | %ad]%Creset %C(yellow)%d%Creset %s' --date=short"
    alias gitlog="git-log" # opcional: atajo más corto
    alias git='f() { if [ "$1" = "log" ]; then shift; git log --graph --all --decorate --pretty=format:"%C(auto)%h%Creset %C(green)[%an | %ad]%Creset %C(yellow)%d%Creset %s" --date=short "$@"; else command git "$@"; fi }; f'

source ~/.bashrc

El resultado se vera similar a esto:

*   beb4c62 [David Moreno | 2025-05-29]  ⚡Eventos: Se inician tareas de deteccion de eventos en room_logic_task
|\  
| * 81d2b9a [David Moreno | 2025-05-28]  (origin/feature/events, feature/events) ⚡Eventos: pantalla lvgl genera eventos en event_bus
| *   de6d7ca [David Moreno | 2025-05-27]  Merge branch 'feature/lvgl' into develop
| |\  
| | * b1a8f46 [David Moreno | 2025-05-26]  (origin/feature/lvgl, feature/lvgl) ✨ Cambio menor: Finalizado comportamiento esperado para botones y sliders
| | * a037753 [David Moreno | 2025-05-23]  🎨 Mejora estética: Aplicados colores diferentes a cada elemento
| * | 6855757 [David Moreno | 2025-05-27]  (origin/feature/mqtt, feature/mqtt) 📑 Recursos:     Disponemos de los valores recibidos en el JSON como variables locales
* | | bd64750 [David Moreno | 2025-05-28]  Importado event_bus de rama events
* | | b09486c [David Moreno | 2025-05-28]  📚 Documentación: Comentado codigo
|/ /  
* / 0fb4380 [Your Name | 2025-05-26]  Feat: mqtt basic helow world connection
|/  
* affd673 [David Moreno | 2025-05-22]  🎨 Mejora estética: Reorganizadas tarjetas a falta de centrado vertical

CLONAR VERSION ESPECIFICA DEL REPOSITORIO

La version se busca a partir del release/tag , en este caso release/v5.3

git clone --recursive https://github.com/espressif/esp-idf.git -b release/v5.3 esp-idf-5.3.0

COMANDOS BASICOS GIT

git init                                            # Inicializa un nuevo repositorio Git
git clone <url>                                     # Clona un repositorio remoto
git status                                          # Muestra el estado del repositorio
git add <archivo>                                   # Añade un archivo al área de staging
git commit -m "mensaje"                             # Crea un commit con mensaje

RAMAS

git branch                                          # Lista las ramas
git branch <nombre>                                 # Crea una nueva rama
git switch <rama>                                   # Cambia de rama
git merge <rama>                                    # Fusiona una rama con la actual

REMOTO

git remote -v                                       # Lista los repositorios remotos
git push origin <rama>                              # Envía los cambios al remoto
git pull origin <rama>                              # Trae los últimos cambios del remoto

OTROS

git log --oneline --graph --decorate --all --color  # Historial de commits
git diff                                            # Muestra cambios sin commitear
git reset --hard && git clean -fdx                  # Revierte al último commit sin guardar

NUEVO REPOSITORIO

git init                                            # Genera directorio .git
git add . && git commit -m "🎉 Primer commit!"      # Prepara el primer commit
git branch -M main                                  # Renombra la rama actual a main
git remote add origin <RUTA_REPOSITORIO.git>        # Indica el origin del proyecto
git push -u origin main                             # Sube el commit

About

Cheat sheet de github

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published