ElAguaDeLaFiesta

comandos-git

Jan 27th, 2022 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. COMANDOS GIT
  2.  
  3. git init // inicializa el repositorio
  4.  
  5. git status // para verificar lo que vamos a subir
  6.  
  7. git add . // para agregar los archivos
  8.  
  9. git commit -m " " // para subir los cambios en el proyecto
  10.  
  11. git branch -M main // para indicar que van a agregarse a la rama principal
  12.  
  13. git remote add origin // en esta parte hay que pegar el enlace de github
  14.  
  15. git push -u origin main // para hacer efectiva la sincronizacion con el repositorio local
  16.  
  17. // PARA RRESOLVER ALGUNOS ERRORES
  18.  
  19.  
  20. //This sovled the issue. If you had a previous mistake in git and want to delete it then do
  21.  
  22. rm -rf .git
  23.  
  24. //Then do
  25.  
  26. git init
  27.  
  28. //To start over
  29.  
  30. // PARA SUBIR NUEVOS ARCHIVOS A LA RAMA PRINCIPAL DEL REPOSITORIO
  31.  
  32. Primeramente hay que hacer un git init para iniciar,
  33. después hay que hacer un git status para ver los archivos que aún no están agregados,
  34. después hay que hacer un git add y escribir el nombre del archivo que se quiere agregar sin comillas o git . si son muchos archivos
  35. después hay que hacer un git commit -m para informar lo que se quiere hacer entre comillas
  36. finalmente hay que hacer un git push -u origin main para que se termine de subir a la rama principal
  37.  
  38. NOTA!
  39.  
  40. a veces hay que hacer git remote add origin [ruta del repositorio].git
  41. despues dice que fatal
  42. y hay que poner git branch -M main
  43. y por ultimo git push -u origin main
  44.  
  45. ----------- OTROS COMANDOS -------------
  46.  
  47. git pull // Hace que se guarden los cambios en local que se realizan en repositorio remoto
  48.  
  49. git tag // mas la fecha de la version del poyecto y el numero de version // -m // mas una descripcion breve entre comillas
  50. // esto permite agregar un tag a un proyecto parcialmente finalizado
  51.  
  52. git push --tags // Hace efectivo el agregado de etiqueta al repositorio remoto
  53.  
  54. git clone // mas la url del proyecto // esto sirve para clonar un repositorio remoto hacia el local
  55.  
  56. git commit --amend // para poder editar un commit
  57.  
  58. git pull // para modificar desde remoto a local
  59.  
  60. ------- Para agregar una tag al proyecto ---------
  61.  
  62. git tag [fechaversion] -m "[descripcion]"
  63.  
  64. then
  65.  
  66. git push --tags
  67.  
  68. ------- Para el error error: failed to push some refs to 'https: ------
  69.  
  70. The full syntax is:
  71.  
  72. git pull --rebase origin main
  73. git push origin main
  74.  
  75.  
  76. git checkout -b <new-branch> // Para crear una nueva rama desde el repo local y cambiar a ella al instante
  77.  
  78.  
Add Comment
Please, Sign In to add comment