Como crear en Linux un repositorio o Distributed Version Control Systems (DVCS),
Instalar git:
$ sudo aptitude install git
Con git instalado, creamos un usuario, que será el encargado de manejar el repositorio.
$ sudo adduser git
Crearemos nuestro repositorio desde el servidor, antes de empezar a trabajar:
$ cd /home/git
$ sudo git init –bare miProyecto
$ sudo chown git.git miProyecto -R
Se ha creado un repositorio vacio, –bare, esto crea solo el repositorio, si no lo ponemos, entenderá que estamos en un directorio de trabajo y nos creara el repositorio para el directorio actual. Esto después nos creará conflictos a la hora de trabajar y hacer push desde el cliente. Lo siguiente es cambiarle el propietario del proyecto, para no tener conflictos de permisos.
Ahora creamos con nuestro cliente y hacemos clone del repositorio:
$ git clone ssh://git@host/~/miProyecto
$ echo “Hola mundo” > index.php
$ git add index.php
$ git commit -m “first commit”
$ git push origin master
Commandos Git & Mercurial
Git | Mercurial |
---|---|
git pull | hg pull -u |
git fetch | hg pull |
git reset –hard | hg up -C |
git revert <commit> | hg backout <cset> |
git add <new_file> | hg add <new_file> (Only equivalent when <new_file> is not tracked.) |
git add <file> | Not necessary in Mercurial. |
git add -i | hg record |
git commit -a | hg commit |
git commit –amend | hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip (Requires the MqExtension.) |
git blame | hg blame or hg annotate |
git blame -C | not available in Mercurial? |
git bisect | hg bisect |
git rebase –interactive | hg histedit <base cset> (Requires the HisteditExtension.) |
git stash | hg shelve (Requires the ShelveExtension or the AtticExtension.) |
git merge | hg merge |
git cherry-pick <commit> | hg graft <cset> |
git rebase <upstream> | hg rebase -d <cset> (Requires the RebaseExtension.) |
git format-patch <commits> and git send-mail | hg email -r <csets> (Requires the PatchbombExtension.) |
git am <mbox> | hg mimport -m <mbox> (Requires the MboxExtension and the MqExtension. Imports patches to mq.) |
git checkout HEAD | hg update |
git log -n | hg log –limit n |
git push | hg push |
Could you show us how you came up with this?
Wow, this post is pleasant, my younger sister is analyzing these things, so I
am going to inform her.