Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@antillas21
Created March 10, 2012 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antillas21/2010707 to your computer and use it in GitHub Desktop.
Save antillas21/2010707 to your computer and use it in GitHub Desktop.
Git Un-Workshop
Instalar y Configurar Git
Instalar Git
Identificándonos
$ git config --global user.name "Mi Nombre"
$ git config --global user.email "email@ejemplo.com"
$ ssh-keygen -t rsa -C "email@ejemplo.com"
Usando Git
$ git init
$ git add archivo(s)
$ git add .
$ git commit -m "Mensaje descriptivo de actividades realizadas"
$ git status
$ git diff [archivo]
$ git branch
$ git checkout [branch]
$ git merge
$ git reset --hard hash
Revisando el historial
$ git log
$ git log --pretty=oneline
$ git log --pretty=oneline --max-count=7
$ git log --pretty=oneline --since='5 minutes ago'
$ git log --pretty=oneline --until='5 minutes ago'
$ git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
$ git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(green)%d%Creset %s %C(cyan)(%cr) %C(magenta)<%an>%Creset' --abbrev-commit --date=relative
Flujo de trabajo
Cuidado con operaciones en archivos que son parte del repositorio (mv, rm)
$ git mv nombre_anterior [ruta/]nombre_nuevo
$ git rm archivo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment