@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?
- Guarda el
git-clase.baten tu USB - Asegúrate que Git portable esté en:
USB\PortableGit\ - Ejecuta el
git-clase.bat
Qué hace esto?
- Carga Git sin instalar
- Abre en Documents del usuario actual
- Agrega alias tipo Linux (ll, gs, ga, etc.)
- Deja todo listo para trabajar
🔥 Ejemplo
gs
ga
gc "primer commit"