|
|
| (No se muestran 20 ediciones intermedias del mismo usuario) |
| Línea 1: |
Línea 1: |
| − | = github =
| + | * [[Creando cuenta en git hub]] |
| − | | + | * [[Establece configuración global]] |
| − | # Crear cuenta en github
| + | * [[Clonando un repositorio existente]] |
| − | # Generar par de claves pública/privada para ssh:
| + | * [[Iniciando un repositorio desde cero]] |
| − | | + | * [[Realizando mi primer commit]] |
| − | <source lang="bash">
| + | * [[Revisando el historial de cambios]] |
| − | % ssh-keygen
| + | * [[Arqueología del software: annotate]] |
| − | </source>
| + | * [[Borrado y renombrado de ficheros]] |
| − | | + | * [[Enviando cambios al servidor: push]] |
| − | # Cargar clave pública SSH a github (zona de 'settings' -> SSH keys). Se encuentra en:
| + | * [[Obteniendo cambios del servidor: pull]] |
| − | | + | * [[Deshaciendo cambios]] |
| − | /home/usuario/.ssh/id_rsa.pub
| + | * [[Revirtiendo cambios]] |
| − | | + | * [[Rehaciendo cambios locales]] |
| − | = Configuración global =
| + | * [[Exportando cambios: Creando una diferencia incremental]] |
| − | | + | * [[Importando cambios: Aplicando una diferencia incremental]] |
| − | Git necesita que se le especifique el nombre y el email del autor del cambio. Esto se hace con las siguientes órdenes:
| + | * [[Empleando nuevas ramas]] |
| − | | + | * [[Enviando una rama al servidor]] |
| − | <source lang="bash">
| + | * [[Usando una rama del servidor]] |
| − | git config --global user.name "Your Name"
| + | * [[Uniendo ramas]] |
| − | git config --global user.email you@example.com
| |
| − | </source>
| |
| − | | |
| − | = clone =
| |
| − | | |
| − | Para usuarios con acceso mediante ssh:
| |
| − | | |
| − | <source lang="bash">
| |
| − | git clone git@github.com:USUARIO/REPOSITORIO.git
| |
| − | </source>
| |
| − | | |
| − | Que pueden aplicar cambios en el repositorio.
| |
| − | | |
| − | Si tienes error del tipo: "Error: Agent admitted failure to sign":
| |
| − | | |
| − | https://help.github.com/articles/error-agent-admitted-failure-to-sign/
| |
| − | | |
| − | = init =
| |
| − | | |
| − | <source lang="bash">
| |
| − | $ git init
| |
| − | </source>
| |
| − | | |
| − | = status =
| |
| − | | |
| − | <source lang="bash">
| |
| − | ~/test2.git$ git status
| |
| − | # On branch master
| |
| − | #
| |
| − | # Initial commit
| |
| − | #
| |
| − | # Untracked files:
| |
| − | # (use "git add <file>..." to include in what will be committed)
| |
| − | #
| |
| − | # README
| |
| − | nothing added to commit but untracked files present (use "git add" to track)
| |
| − | practica@LSI-160:~/test2.git$ git add README
| |
| − | practica@LSI-160:~/test2.git$ git status
| |
| − | # On branch master
| |
| − | #
| |
| − | # Initial commit
| |
| − | #
| |
| − | # Changes to be committed:
| |
| − | # (use "git rm --cached <file>..." to unstage)
| |
| − | #
| |
| − | # new file: README
| |
| − | #
| |
| − | </source>
| |
| − | | |
| − | = config =
| |
| − | | |
| − | git config --global user.email you@example.com
| |
| − | practica@LSI-160:~/test2.git$ git config --global user.email pneira@us.es
| |
| − | | |
| − | = commit =
| |
| − | | |
| − | git commit
| |
| − | | |
| − | = log =
| |
| − | | |
| − | git log
| |
| − | | |
| − | = push=
| |
| − | | |
| − | <source lang="bash">
| |
| − | $ git push origin master
| |
| − | Counting objects: 5, done.
| |
| − | Delta compression using up to 4 threads.
| |
| − | Compressing objects: 100% (2/2), done.
| |
| − | Writing objects: 100% (3/3), 329 bytes, done.
| |
| − | Total 3 (delta 0), reused 0 (delta 0)
| |
| − | To git@github.com:egc-profe/test2.git
| |
| − | 9d95b3f..b32395c master -> master
| |
| − | </source>
| |
| − | | |
| − | = branch / checkout =
| |
| − | | |
| − | <source lang="bash">
| |
| − | practica@LSI-160:~/test2.git$ git branch test
| |
| − | practica@LSI-160:~/test2.git$ git branch
| |
| − | * master | |
| − | test
| |
| − | practica@LSI-160:~/test2.git$ git checkout test
| |
| − | Switched to branch 'test'
| |
| − | practica@LSI-160:~/test2.git$ git branch
| |
| − | master
| |
| − | * test | |
| − | practica@LSI-160:~/test2.git$ git checkout master
| |
| − | Switched to branch 'master'
| |
| − | practica@LSI-160:~/test2.git$ git branch -D test
| |
| − | Deleted branch test (was b32395c).
| |
| − | practica@LSI-160:~/test2.git$ git branch
| |
| − | * master | |
| − | </source>
| |
| − | | |
| − | = clone =
| |
| − | | |
| − | <source lang="bash">
| |
| − | git clone git@github.com:egc-profe/test2.git
| |
| − | Cloning into 'test2'...
| |
| − | remote: Counting objects: 9, done.
| |
| − | remote: Compressing objects: 100% (5/5), done.
| |
| − | remote: Total 9 (delta 0), reused 9 (delta 0)
| |
| − | Receiving objects: 100% (9/9), done.
| |
| − | </source>
| |
| − | | |
| − | = revert =
| |
| − | | |
| − | $ git log --oneline
| |
| − | da883f2 add .gitignore file
| |
| − | b32395c Update README file
| |
| − | 9d95b3f This is my initial commit
| |
| − | | |
| − | $ git revert b32395c
| |