Site Tools


informatique:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatique:git [2024/11/18 19:41] yahikoinformatique:git [2024/12/08 16:04] (current) yahiko
Line 1: Line 1:
 ====== Git ====== ====== Git ======
  
-Bloc note de commandes concernant git. Parce que concrètement, j'y vais un peu pif. Faudrait que je lise la doc, un jour.+Bloc note de commandes concernant Git. Parce que concrètement, j'y vais un peu pif. Faudrait que je lise la doc, un jour.
  
 {{ :informatique:dog-no-ideae.jpg?nolink& 400 | I have no idea what I'm doing}} {{ :informatique:dog-no-ideae.jpg?nolink& 400 | I have no idea what I'm doing}}
Line 15: Line 15:
 Tout est volé ici : https://www.it-connect.fr/comment-generer-une-paire-de-cles-ssh-et-lutiliser-avec-gitlab/ Tout est volé ici : https://www.it-connect.fr/comment-generer-une-paire-de-cles-ssh-et-lutiliser-avec-gitlab/
  
-J'utilise le GitLab de Tedomum qui ne propose que l'authentification par SSH. OpenSSH est intégré sous Windows 10 et 11.+J'utilise le GitLab de Tedomum avec une authentification SSH. L'authentification par token HTTPS est aussi disponible mais je n'ai vu ça qu'après. OpenSSH est intégré sous Windows 10 et 11.
  
 Générer une clef :  Générer une clef : 
Line 81: Line 81:
 cd dossier_du_projet cd dossier_du_projet
 git init git init
-git remote add origine git@forge.tedomum.net:utilisateur/projet.git+git remote add origin git@forge.tedomum.net:utilisateur/projet.git
 </code> </code>
  
Line 106: Line 106:
 git add . git add .
 git commit -m "Version initiale" git commit -m "Version initiale"
 +git push --set-upstream origin main
 +</code>
 +
 +Lors du premier envoi : 
 +<code bash>
 +git push --set-upstream git@forge.tedomum.net:utilisateur/projet.git main
 +</code>
 +
 +Si problème lors du push : 
 +<code bash>
 +git pull --rebase origin main
 git push --set-upstream origin main git push --set-upstream origin main
 </code> </code>
  
 {{ :informatique:dog-sweat.gif?nolink |}} {{ :informatique:dog-sweat.gif?nolink |}}
 +
 +===== Git pull =====
 +
 +Pour récupérer le projet sur un autre machine 
 +
 +<code bash>
 +mkdir dossier && cd dossier
 +git init
 +git pull git@forge.tedomum.net:utilisateur/projet.git
 +</code>
informatique/git.1731958896.txt.gz · Last modified: 2024/11/18 19:41 by yahiko