sábado, 15 de marzo de 2014

Comprobando el status de tus archivos

cms@desarrollo:/var/www/git$ git status
# On branch master
nothing to commit (working directory clean)

El comando te dice en qué rama estás. Por ahora, esa rama siempre es "master", que es la predeterminada.

si agregamos un archivo

cms@desarrollo:/var/www/git$ touch index.html
cms@desarrollo:/var/www/git$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    index.html
nothing added to commit but untracked files present (use "git add" to track)

 Para empezar el seguimiento de un nuevo archivo se usa el comando git add.

cms@desarrollo:/var/www/git$ git add index.html
cms@desarrollo:/var/www/git$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   index.html
#

Puedes ver que está preparado porque aparece bajo la cabecera “Cambios a confirmar” (“Changes to be committed”). 

Al modificar el archivo index.html pero aun no esta preparado

cms@desarrollo:/var/www/git$ nano index.html
cms@desarrollo:/var/www/git$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   index.html

Archivo preparado

cms@desarrollo:/var/www/git$ git add index.html
cms@desarrollo:/var/www/git$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   index.html
#
cms@desarrollo:/var/www/git$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    modified:   README
#    new file:   index.html
#
Se modifico y se se preparo.




Ignorando archivos


$ cat .gitignore
*.[oa]
*~
 
 



No hay comentarios:

Publicar un comentario