GIT - ADVANCED
Links
//GIT
Visual Code con solo una carpeta
Abrir Terminal ctrl + ñ
git init
git add . (Arcihivos pasan de U Unfollow a A added , M Modificaciones)
git commit
git push origin main // to send to github/gitlab cambiando origin/main si necesario
git branch -d branchName
git checkout branchName
git remote add origin https://github.com/XXXXXXXX
git remote add origin2 https://github.com/XXXXXXXX
git pull: recibir info from github
git merge nameBranch // git merge test
after merge git push origin main // ** and delete the other branch
//VISUAL CODE VIDEO - GITHUB
Asociar repositorio de Github a carpeta en local:
Saber la url
View > Command palette ctrl shift p
Git Clone
introducir URL > autorizar
Seleccionar carpeta donde va a estar
Crear archivo o hacer cambios y subir a github:
Ir al menu de source control, introducir mensaje y ctrl + enter o luego commit
Ir a 3 puntos Push o abajo a sincronizar
Tambien en terminal git push
Cambiar algo en github y que se modifique en local:
Sincronizar: abajo a la izquierda
Sincronizar:
vale tanto si hay cambios en github y se quieren actualizar en local o viceversa
// MULTIPLE REMOTES
Crear repositorio > Opciones quick setup > "push an existing repository from the command line"
git remote add origin https://github.com/XXXXXXXX
git push origin main
git remote add origin2 https://gitlab.com/XXXXX
git push origin2 main
// AUTHENTICATION
password vs ssh
git remote -v
PASSWD - origin https://github.com/Albtor/3dsocialmediaicons.git (fetch) (push)
SSH - origin git@github.com:Albtor/3dsocialmediaicons.git (fetch) (push)
CHANGE: git remote set-url origin git@github.com:Albtor/3dsocialmediaicons.git
//BRANCHES DESDE GITHUB
Github: En Master > Nombre y enter
Hacer modificaciones en files y luego eligiendo la rama master
Merge
Open & Pull request
Despues del merge se puede borrar la rama, se suele hacer desde github
//GIT FORK
Nuevo repositorio
Pull Request: Peticion o sugerencia para que vea tu modificación en el proyecto
El programador original puede rechazar el pull request de la otra persona, pero también lo puede aceptar e incorporar
Go to any proyect and click on Fork
Lo crea en tu perfil, puedes hacer cambios y subirlos.
Si quieres avisar al programador original, solicitamos pull request
//GIT NETBEANS
versioning
realizar cambios y git > commit
git > remote > Push