====== GIT Notas ======
Para descargar el GIT oficial:
* [[https://git-scm.com/]]
La última versión que funciona con Windows 7 64bit, es GIT 2.46.2 [[https://www.filepuma.com/download/git_for_windows_64bit_2.46.2-41605/|Descargar una versión en filepuma.com]]
Interesante página que muestra como se guarda el archivo en el sistema git
* [[https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/]]
Usar Git-Extensions porque tiene buen GUI [[http://gitextensions.github.io/]]
Complementarlo con Git-ftp [[http://www.codingsips.com/install-configure-git-ftp-windows/|Manual de Instalación en Windows Git-FTP]]
{{ youtube>HiXLkL42tMU?medium }}
comandos bash
[[https://sanchezcorbalan.es/navegar-por-los-directorios-y-ver-su-contenido-cd-pwd-y-ls/|comandos bash linux]]
Muestra la carpeta en la que está trabajando:
pwd
Muestra los archivos de la carpeta en la que está:
ls
bajar de carpeta (ojo, hay espacio cd y ..)
cd ..
Eliminar carpeta
rmdir
rmdir -p
rm -R
[[https://lignux.com/como-eliminar-carpetas-desde-la-terminal-en-gnu-linux/|fuente]]
mkdir
ls -ld
chmod 700
cd
[[https://www.nettix.com.pe/documentacion/administracion/linux-administracion/creando-archivos-y-directorios-en-linux|fuente]]
===== Comandos GIT =====
* [https://www.youtube.com/watch?v=HiXLkL42tMU]]
#Crear nuevo repositorio, debes ubicarte en la carpeta y poner
git init
#Ver status de los archivos
#Puedes ver:
# - Que carpeta
git status
#Agregar a seguimiento
git add
#Crear usuario
git config --global user.email "test@das.com"
git config --global user.name "usuario1"
#Crear un punto
git commit
#Crear un punto sin ir al editor y agregar mensaje.
git commit -m "cambio a las 2020-02-04"
#Ver los commit, los estados
git log
#Restaurar al ultimo commit
git checkout
#Restaurar (nuevo comando como checkout)
git switch main (main branch default)
git switch
#Ver las diferencias con respecto al commit
git diff
==== Ignorar archivos y carpetas ====
para ignorar archivos por el GIT debes crear un archivo con ".gitignore" y ahí debes escribir las carpetas o los archivos que se van a ignorar, no olvidar que tiene que ser agregado con git add para que excluya.
==== Branch ====
* [[https://git-scm.com/book/es/v2/Ramificaciones-en-Git-%C2%BFQu%C3%A9-es-una-rama%3F]]
{{ youtube>ZBexzpgj1GE? }}
Manejo de versionados (brand, checkout):
#Ver los forks y mostrar en cual estás
git branch
#Crear Branch
git branch
#1o:
git checkout -b
#2do:
git switch -c
#elegir branch
git checkout
#
# Al elegir el branch, tienes que agregar
# a los que son parte del branch
#
#Agregar los archivos a ese branch
#en este caso el punto . agrega a todos
#sin especificarlo
git add .
#crea un punto para ese branch
git commit -m "primer cambio en la nueva rama"
usar con cuidado:
# Renombrar el branch en que estas.
git branch -m
# Borrar el branch
git -D
* [[https://sethrobertson.github.io/GitFixUm/fixup.html]]
* [[https://www.shellhacks.com/git-remove-all-commits-clear-git-history-local-remote/]]
==== Remoto ====
* [[https://git-scm.com/book/es/v2/Fundamentos-de-Git-Trabajar-con-Remotos]]
* [[https://www.youtube.com/watch?v=18tXFctuqQ0|Cpanel y Git]]
git remote add origin http://....
git push -u origin
#Para traer un proyecto desde remoto a una carpeta
git clone
# Para ver una lista de los "remote"
git remote -v
==== SSH ====
* [[https://help.github.com/es/github/authenticating-to-github/checking-for-existing-ssh-keys]]
* [[https://stackoverflow.com/questions/23064052/how-to-modify-ssh-folder-files-in-windows]]
* [[https://serverfault.com/questions/194567/how-do-i-tell-git-for-windows-where-to-find-my-private-rsa-key]]
* [[https://flaviocopes.com/how-to-setup-git-ssh-keys/]]
SSH in Cpanel
* [[https://www.youtube.com/watch?v=CCX0mMaEEKc]]
Comandos SSH para complementar:
# Verificar si se esta ejecutando el agente ssh
eval $(ssh-agent -s)
# otra forma de comprobar el SSH-agent
eval ssh-agent
# Probar el logeo con un usuario:
ssh -T usuario@servidor.com
# Probar logeo con más detalles:
ssh -v usuario@servidor.com
==== Hook ====
[[http://www.danielnavarroymas.com/deploy-automatico-de-versiones-con-git/]]
==== Conexion ====
#Para listar los servidores remotos:
git remote -v
git push -u origin
git remote a
# Configurar remote url
git remote set-url origin
https://:@//.git
* **git fetch:** Downloads new data and changes from the remote repository to your local machine, without integrating them into your current working branch. This is considered the "safe" option for checking for updates.
* **git pull:** Performs a git fetch immediately followed by a git merge (or git rebase if configured) to integrate the remote changes into your current local branch. This can lead to merge conflicts if not used carefully.
* **git push:** Uploads your local commits to the remote repository, sharing your changes with others.
==== Notas VIM ====
vim:
[ i ] <- insertar
[ : ][ w ][ q ] <- grabar
Mas comandos GIT
* [[https://git-scm.com/book/es/v2/Appendix-B%3A-Comandos-de-Git-Seguimiento-B%C3%A1sico]]
===== SQL SERVER y GITHUB =====
* [[https://www.red-gate.com/hub/product-learning/sql-source-control/github-and-sql-source-control]]
* [[https://aspnetcoremaster.com/slqserver/control-de-versiones-sql-server-git.html]]
Sobre SVN:
* [[https://robertomiguelz.blogspot.com/2019/04/buenas-practicas-al-usar-subversion-svn.html]]