@echo off
title Git portable

set "BASE=%~dp0"

REM Buscar git.exe automáticamente
if exist "%BASE%PortableGit\cmd\git.exe" set "GITPATH=%BASE%PortableGit\cmd"
if exist "%BASE%PortableGit\bin\git.exe" set "GITPATH=%BASE%PortableGit\bin"
if exist "%BASE%PortableGit\mingw64\bin\git.exe" set "GITPATH=%BASE%PortableGit\mingw64\bin"

set "PATH=%GITPATH%;%PATH%"

echo Usando Git en: %GITPATH%
git --version

cd /d %USERPROFILE%\Documents

REM === Mensaje inicial ===
echo ================================
echo   ENTORNO DE TRABAJO LISTO
echo ================================
echo Usuario: %USERNAME%
echo Carpeta: %CD%
echo.

REM === Alias utiles ===
doskey ll=dir /o /p
doskey gs=git status
doskey ga=git add .
doskey gc=git commit -m "$"
doskey gp=git push
doskey gl=git log --oneline
doskey gcl=git clone $
doskey cls=cls

echo Alias disponibles:
echo   ll   - listar archivos
echo   gs   - git status
echo   ga   - git add .
echo   gc   - git commit
echo   gp   - git push
echo   gl   - git log corto
echo.

REM === Abrir consola interactiva ===
cmd

Como usarlo?

  1. Guarda el git-clase.bat en tu USB
  2. Asegúrate que Git portable esté en: USB\PortableGit\
  3. Ejecuta el git-clase.bat

Qué hace esto?

  1. Carga Git sin instalar
  2. Abre en Documents del usuario actual
  3. Agrega alias tipo Linux (ll, gs, ga, etc.)
  4. Deja todo listo para trabajar

🔥 Ejemplo

gs
ga
gc "primer commit"