Comparaciones odiosas: git contra el mundo
Restaurar ficheros borrados:
- svn:
svn up - mercurial:
hg reset --all - git:
git ls-files -d | xargs git checkout --#(no es broma)
Aviso de que tu repo está desactualizado al intentar subir tus cambios
Con svn:
$ svn ci
svn: Desactualizado: 'nombre_de_fichero' en transacción '2255-1'Con git:
$ git push
! [rejected] master -> master (non-fast forward)Información de estado
Con svn:
$ svn st
? nuevo.txt
M modificado.cSi no hay ficheros nuevos, no lista nada, admite -q (quiet) y -v (verbose)
Con mercurial:
$ hg stSi no hay ficheros nuevos, no lista nada, admite -q (quiet), -v (verbose) y también filtrando por tipo: añadido, modificado, borrado, etc entre otras. El formato de la salida es muy similar al de svn, pero además se pueden usar plantillas para su generación.
Con git:
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file1.h
# file2.h
[... TODOS los que haya sin posibilidad de resumir ...]
nothing added to commit but untracked files present (use "git add" to track)No admite ningún parámetro para controlar o modificar el resultado del comando.
Averiguar el repo original del que se clonó éste
Con mercurial
$ hg pathCon git:
$ git remote show originCambiar la URL del repo original
Con mercurial
Edita el fichero .hg/hgrc:
[paths]
default = http://www.selenic.com/repo/hg
default-push = http://hg.example.com/hgCon git:
$ git remote set-url origin URL [ show comments ]
blog comments powered by Disqus