93 views
# Formation Git : Introduction et Prise en Main 🚀 Bienvenue dans ce tutoriel ! Suivez ces Ă©tapes pour apprendre Ă  utiliser Git et contribuer efficacement au projet **Astroport.solo**. 🌟 --- ## PrĂ©requis 📋 ### Installation de Git Sur un systĂšme **Linux**, ouvrez un terminal et installez Git : ```bash sudo apt install git ``` Pour les utilisateurs de **Windows**, tĂ©lĂ©chargez et installez Git depuis [Git for Windows](https://gitforwindows.org/). Vous aurez accĂšs Ă  un terminal Git (Git Bash) pour suivre cette formation. --- ## Connectez-vous Ă  votre compte GitHub đŸ‘€ CrĂ©ez un compte GitHub si ce n’est pas dĂ©jĂ  fait : [GitHub.com](https://github.com) Ensuite, connectez-vous Ă  votre compte : ```bash VOTRECOMPTE=<votre-nom-utilisateur-GitHub> ``` --- ## Forker le projet Astroport.solo 🍮 Un "fork" permet de crĂ©er une copie personnelle d’un projet sur votre compte GitHub. Allez sur le dĂ©pĂŽt officiel et forkez-le : [Astroport.solo](https://github.com/papiche/Astroport.solo) Vous aurez maintenant votre propre version du projet dans `https://github.com/$VOTRECOMPTE/Astroport.solo`. --- ## Configurer les clĂ©s SSH 🔐 ### Pourquoi des clĂ©s SSH ? Les clĂ©s SSH permettent de sĂ©curiser les connexions entre votre ordinateur et GitHub sans avoir Ă  entrer un mot de passe Ă  chaque fois. ### CrĂ©ez une clĂ© SSH avec chiffrement ED25519 Dans votre terminal : ```bash ssh-keygen -t ed25519 -C 'votre@email' ``` Cela crĂ©e une paire de clĂ©s privĂ©e/publique dans le rĂ©pertoire `~/.ssh`. Ensuite, affichez votre clĂ© publique : ```bash cat ~/.ssh/id_ed25519.pub ``` ### Ajoutez votre clĂ© publique sur GitHub 1. Connectez-vous Ă  votre compte GitHub. 2. Allez dans **Settings** → **SSH and GPG keys** → **New SSH key**. 3. Copiez le contenu de `id_ed25519.pub` et collez-le dans le champ prĂ©vu. Donnez un nom Ă  la clĂ© (ex. : "Mon PC"). 4. Validez en cliquant sur **Add SSH key**. --- ## Cloner le dĂ©pĂŽt dans votre espace de travail đŸ–„ïž CrĂ©ez un dossier pour votre projet : ```bash mkdir ~/workspace cd ~/workspace ``` Clonez votre fork : ```bash git clone git@github.com:$VOTRECOMPTE/Astroport.solo.git ``` Vous aurez maintenant une copie locale du projet dans `~/workspace/Astroport.solo`. --- ## CrĂ©ez une branche pour vos modifications đŸŒ± Dans Git, une **branche** permet de travailler sur une nouvelle fonctionnalitĂ© ou une correction sans affecter le reste du projet. CrĂ©ez et passez sur une branche appelĂ©e `myaddon` : ```bash cd ~/workspace/Astroport.solo git branch myaddon git checkout myaddon ``` Vous ĂȘtes maintenant prĂȘt Ă  modifier le code ! 🎉 --- ## Modifiez le code, puis publiez vos changements âœïžđŸ“€ ### Étapes pour publier votre travail : 1. **Ajoutez les fichiers modifiĂ©s** : ```bash git add . ``` 2. **Validez les modifications avec un message clair** : ```bash git commit -m 'Ajout de ma fonctionnalitĂ©' ``` 3. **Envoyez vos modifications sur GitHub** : ```bash git push ``` Vos changements sont maintenant sur votre fork GitHub. ✅ --- ## Faites une Pull Request (PR) 🔄 Une **Pull Request** permet de proposer vos modifications au projet principal. Pour cela : 1. Allez sur la page de votre dĂ©pĂŽt : [https://github.com/$VOTRECOMPTE/Astroport.solo](https://github.com/$VOTRECOMPTE/Astroport.solo) 2. Cliquez sur **Compare & Pull Request**. 3. RĂ©digez un commentaire clair expliquant vos modifications. 4. Envoyez votre PR au projet principal de `papiche`. **Bravo 🎉** : Vous avez contribuĂ© au projet ! --- ## Gardez votre fork Ă  jour avec le dĂ©pĂŽt principal 🔄 Pour synchroniser votre fork avec les derniĂšres modifications : 1. Configurez le dĂ©pĂŽt principal comme une nouvelle **remote** : ```bash git remote add upstream git@github.com:papiche/Astroport.solo.git ``` 2. RĂ©cupĂ©rez les modifications : ```bash git fetch upstream git merge upstream/main ``` Ainsi, votre fork sera toujours Ă  jour. đŸ•Šïž --- ## Extra tips 🧙 - Rejoignez la communautĂ© **Astroport.ONE Dragon Swarm** pour collaborer et Ă©changer : [Astroport.ONE](https://github.com/papiche/Astroport.ONE) - Explorez le **Ğ1FabLab** et ses projets innovants si vous travaillez avec la Monnaie Libre. - Si vous utilisez Windows, privilĂ©giez **Git Bash** pour suivre ce guide. --- PrĂȘt pour la suite ? **À vous de jouer !** ✹