Created: 2026-02-05 jue 10:19
Ejemplos
master o main: Rama principal del desarrollo
branch) es un nombre que se da a un hash, y que va avanzando al hacer nuevas versionestag es como un branch, pero no avanza al hacer nuevas versionesmaster o main: Versiones oficiales del código
develop: Trabajo para las siguientes versiones oficiales
masterfeature: Trabajo para una sola funcionalidad
develophotfix: Un arreglo urgente en master
init.gitalvaro@debian8-64-alvarogonzalez:~/aplicacion-web$ git init
Initialized emp
clone master alvaro@debian8-64-alvarogonzalez:~/aplicacion-web$ git clone https://github.com/alvarogonzalezsotillo/aplicacion-php.git
Cloning into 'aplicacion-php'...
remote: Counting objects: 50, done.
remote: Compressing objects: 100%
....
add addaddrm (las versiones antiguas siguen en el repositorio)status
diffMuestra los cambios de los ficheros en estado modified
@@ -lineO,nlinesO +lineD,nlinesD @@
lineO del fichero antiguo y lineD del fichero actualnlinesO líneas del fichero antiguo y nlinesD líneas del fichero actual- Línea borrada+ Línea añadidacommit [master 906fa20] Cambiados varios permisos de ejecución
5 files changed, 411 insertions(+), 2 deletions(-)
create mode 100644 09/estados-fichero-git.svg
mode change 100755 => 100644 borrar-temporales-latex.sh
mode change 100755 => 100644 generar-pdf.sh
mode change 100755 => 100644 generar-pdfs.sh
mode change 100755 => 100644 publicar-pdfs.sh
push git clone (en este caso se denomina origin)git remote addgit pull previoComando git push Comando git remote
alvaro@debian8-64-alvarogonzalez:~/aplicacion-web$ git push
Password for 'https://alvarogonzalezsotillo@bitbucket.org':
To https://alvarogonzalezsotillo@bitbucket.org/alvarogonzalezsotillo/aplicacion-web.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to
'https://alvarogonzalezsotillo@bitbucket.org/alvarogonzalezsotillo/aplicacion-web.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
pull checkout git checkout <fichero>git checkout <hashdeversión>git checkout <branch>git checkout -b <nombrerama>merge git checkout --theirs path/filegit checkout --ours path/filegit addgit mergetool, o usar el IDEComando git merge: Fusión de dos ramas
translate a partir de master (comando checkout o branch)translate (comando add y commit)master
git checkout mastergit merge --no-ff translategit log --graph --oneline
clonecurso-2025-2026
checkoutlistado-alumnos.md y añade tu nombre y apellidos en el orden correctoadd,commit)push
pull, y vuelve a intentar subir tus cambiosSQLite3forgejo-datapodman run -d \
--replace \
--name=forgejo \
-v forgejo-data:/data \
-v /etc/localtime:/etc/localtime:ro \
-p 3000:3000 \
-p 2222:22 \
codeberg.org/forgejo/forgejo:14