Piste :

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
prog:git [2021/08/28 16:53] – modification externe 127.0.0.1prog:git [2024/04/03 14:04] (Version actuelle) cb
Ligne 1: Ligne 1:
 ====== Git ====== ====== Git ======
 +
 +===== Prérequis =====
 +Dans windows il faut cliquer sur source control et download Git for Windows
 ===== Marche à suivre pour création d'un projet en copiant le git en local ===== ===== Marche à suivre pour création d'un projet en copiant le git en local =====
 il faut créer un dossier vide et y aller il faut créer un dossier vide et y aller
Ligne 6: Ligne 9:
 git pull https://romote.git git pull https://romote.git
 </code> </code>
 +
 +
 +Aller dans le répertoire .ssh
 +ouvrir un éditeur et copier le contenu. Copier dans 
 +https://gitlab.com/-/profile/keys
  
 ===== Marche à suivre pour création d'un projet ===== ===== Marche à suivre pour création d'un projet =====
Ligne 11: Ligne 19:
 git config --global user.name "prénom nom" git config --global user.name "prénom nom"
 git config --global user.email "mettre ici email" git config --global user.email "mettre ici email"
 +git config --global init.defaultBranch <nom>
 +
  
 cd existing_folder cd existing_folder
Ligne 21: Ligne 31:
 </code> </code>
  
 +Push an existing forder
 +<code>
 +cd existing_folder
 +git init --initial-branch=main
 +git remote add origin git@gitlab.com:chb2/devperso.git
 +git add .
 +git commit -m "Initial commit"
 +git push -u origin main
 +</code>
  
  
Ligne 39: Ligne 58:
  
 git push https://user:motdepasse@gitlab.com/user/projet --all git push https://user:motdepasse@gitlab.com/user/projet --all
 +
 +===== copier la clé sur gitlab=====
 +Aller dans .ssh et avec un éditeur copier le contenu et le coller dans 
 +
 +[[https://gitlab.com/-/profile/keys]]
 +
 +
 +===== Changer d'adresse git ===== 
 +<code>
 +# voir les dépots distants actuels
 +git remote -v 
 +# changement de dépot
 + git remote set-url origin git@url.com/ATLAS/_git/nouveaunom
 +</code>
  
 [[prog:index|Retour programmation]] [[prog:index|Retour programmation]]