-
Se crea el repositorio git init
-
Se suben los archivos a la zona de preparacion git add Xarchivos
-
Se comenta el porque de esos archivos git commit -m ‘bla bla bla’
-
En caso de no existir, se añade el repositiorio remoto git remote add origin https://[email protected]/bla/bla.git git remote add origin https://github.com/USERNAME/PROJECT-NAME
SSH git remote add origin [email protected]:USERNAME/PROJECT-NAME.git
-
Se suben los cambios al repositorio Primera vez
git push origin master
Demas veces
git push -u origin --all
Hacer fork de un codigo en bitbucket/Github. Luego clonarlo, cambiarlo, y hacer un pull request al dueño del branch original
git clone https://[email protected]/administrador/nombre-del-repo.git nuevoNombreRepo
git clone https://github.com/fulanito/nombre-repo.git -b NOMBRE-RAMA nuevoNombreRepo
git clone https://[email protected]/fulanito/nombre-del-repo.git .
git add ‘.py’
git add -A
git rm ‘.txt’
git rm -r ‘doodle’
git commit -m “Listo ya añadi tal cosa”
git branch clean_up
git branch -a
git checkout clean_up
git checkout master
git checkout -b BRANCH-NAME origin/BRANCH-NAME
git branch -d clean_up
git push https://[email protected]/fulanito/proyecto-version01.git
git ls-files --others -i --exclude-standard
git rm $(git ls-files --deleted)
git stash
git stash list
git stash pop
git reset --hard origin/<branch-name>
git revert 12e33ce45
Esto devolverá los cambios realizados en el commit 12e33ce45. Luego de ello se pueden resolver conflictos y volver a subir cambios al remoto. Se agregará como un nuevo commit a la historia Fuente:
git remote prune origin
git fetch origin pull/1234/head:NOMBRE-PR-1234
git checkout NOMBRE-PR-1234
git checkout master
git merge --no-ff -m 'Merged in featuredbranch (pull request #11)' remotes/origin/featurebranch
https://stackoverflow.com/questions/9069061/what-is-the-difference-between-git-merge-and-git-merge-no-ff
git rm -r --cached . ( git rm --cached <ARCHIVO> )
git add .
git commit -m ".gitignore ahora esta funcionando"
git clean -fd
git add ARCHIVO_OLVIDADO
git commit --amend --no-edit
* editar mensaje
git commit --amend
git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
git branch -m master main
git checkout master
git pull
git checkout development
git merge master
=================================================================================
Cambiarse a una rama credaa remotamente
git checkout -b hotfix-docker origin/hotfix-docker
=================================================================================
- Documentation: https://docs.gitlab.com/user/ssh/#generate-an-ssh-key-pair
If you are using different ssh file instead of the default id_rsa. You need to add that ssh file using ssh-add. run:
ssh-add <PATH-TO-SSH-FILE>
example: ssh-add ~/.ssh/gitlab_rsa
ssh -T [email protected]
Debe coincidir el ssh host key fingerprint
vim ~/.ssh/config
- Luego escribe
Host gitlab.com
AddKeysToAgent yes
UseKeychain yes
PreferredAuthentications publickey
IdentityFile ~/.ssh/file_gitlab_rsa
- Ya luego si se hace ssh-add ~/.ssh/gitlab_rsa
- Si ya existe localmente, crea el repositorio y sigue la guía de gitlab
=================================================================================
Video de youtube con enlace
Este video explica para que son los workflw dispatch
Fuente:
git config --global core.editor "vim --nofork"
El archivo .gitconfig debe verse mas o menos así
[user]
email = [email protected]
name = Juan Perez
[core]
editor = vim --nofork
git tag -a v1.0 -m "Mensaje para el commit de la etiqueta"
git push origin v1.0
-
Guía: https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/
feat
– a new feature is introduced with the changesfix
– a bug fix has occurredchore
– changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)refactor
– refactored code that neither fixes a bug nor adds a featuredocs
– updates to documentation such as a the README or other markdown filesstyle
– changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.test
– including new or correcting previous testsperf
– performance improvementsci
– continuous integration relatedbuild
– changes that affect the build system or external dependenciesrevert
– reverts a previous commit
=================================================================================
- Documentation: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
ssh -T [email protected]
# Attempts to ssh to GitHub