Tutoriels officiels divers sur GitHub
- GitHub Help
- GitHub Learning Lab
- GitHub Guides
- On Demand Training
- YouTube – GitHub Trainging & Guides
- Mastering Markdown
- Writing on GitHub
- Aide-mémoire GitHub Git
- Firefox Extension – Refined GitHub
Fichiers et dossiers communément utilisés
- README.md : décrit le projet, sa procédure d’installation, etc.
- LICENSE : la licence du projet
- CONTRIBUTING.md : décrit le procédé requis afin de contribuer au projet
- ISSUE_TEMPLATE.md : template destiné à signaler un bug du projet
- .git/ : dossier caché créé lors de l’initialisation locale du dépôt ou d’un clonage distant
- .gitignore : fichier référençant les fichiers ou dossiers exclus de l’index et donc des commits
- docs/ : documentation du projet
Le formatage Markdown
Liste de tâches
- [x] Additional markup is supported, including @mentions, #referencess, [links](url), **emphasis**, andHTML tags. - [x] List syntax is required. - You can nest lists below, too! - [x] This item is completed. - [ ] This item is not complete.
☑ Additional markup is supported, including @mentions, #referencess, links, emphasis, and HTML tags. ☑ List syntax is required. ο You can nest lists below, too! ☑ This item is completed. ☐ This item is not complete.
Les différents headers
# This is an <h1> header, which is the largest ## This is an <h2> header ###### This is an <h6> header, which is the smallest
This is an <h1> header, which is the largest
This is an <h2> header
This is an <h6> header, which is the smallest
Insertion d’une image

Ajouter un lien
[GitHub](http://github.com)
GitHub
Ajouter des emojis
![]() |
:smile: |
![]() |
:+1: |
![]() |
:heart: |
![]() |
:sparkles: |
![]() |
:tada: |
Liste ordonnée
1. Item 1 2. Item 2 3. Item 3 1. Item 3a 2. Item 3b
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
Liste désordonnée
* Item 1 * Item 2 * Item 2a * Item 2b
- Item 1
- Item 2
- Item 2a
- Item 2b
Texte en italique ou en gras
*This text will be italic* _This will also be italic_ **This text will be bold** __This will also be bold__ _You **can** combine them_
This text will be italic This will also be italic This text will be bold This will also be bold You can combine them
Citations
In the words of Abraham Lincoln: > Pardon my French
Tableaux
``` First Header | Second Header ------------ | ------------- Content from cell 1 | Content from cell 2 Content in the first column | Content in the second column ```
Inline Code Blocks
`inline code is just one backtick`
inline code is just one backtick
Paragraphe de codes non interprétés
Anything written in this **paragraph** will not be _formatted_ even if it would normally be recognized in this setting. :+1:
sera normalement interprété comme ci-dessous :
Anything written in this paragraph will not be formatted even if it would normally be recognized in this setting.
Pour ne pas l’interpréter, il suffit de l’encadrer des caractères suivants : ```
```Anything written in this **paragraph** will not be _formatted_ even if it would normally be recognized in this setting. :+1:```
Anything written in this **paragraph** will not be _formatted_ even if it would normally be recognized in this setting. :+1:
Idem pour des lignes de code :
```sh github-learning-lab ~/Projects/recipe-repository $ git init Initialized empty Git repository in /Users/github-learning-lab/Projects/recipe-repository/.git/ ```
github-learning-lab ~/Projects/recipe-repository $ git init Initialized empty Git repository in /Users/github-learning-lab/Projects/recipe-repository/.git/
Bloc de texte expansible
<details> <summary>Title</summary> Content here </details>
Title
Content here
GitHub Pages organisation
https://username.github.io/repository/
Un fichier nommé index (md, html,…) est d’abord recherché. S’il n’est pas trouvé, c’est le fichier README.md qui sera lu. Ci-dessous, 3 fichiers sont inclus dans ce fichier index, ils sont affichés dans l’ordre d’inclusion.
Les informations relatives au thème utilisé et certaines préférences du site sont stockées dans le fichier _config.yml dont les métadonnées sont rédigées en YAML.
Fichier index.md
--- layout: default --- {% include file01.md %} <br> {% include file02.md %} <br> {% include file03.md %}
Dans un dossier _includes, au même niveau que index.md, placer les fichiers suivants :
- file01.md
- file02.md
- file03.md
Fichier _config.yml
title: Bienvenue sur mon site! author: John Doe email: john.doe@example.com description: Description de mon site theme: jekyll-theme-cayman
├── _config.yml ├── _includes │ ├── file01.md │ ├── file02.md │ └── file03.md ├── index.md └── README.md
Connexion sécurisée à GitHub avec SSH
(source Connecting to GitHub with SSH)
Configuration sur le client
Générer un couple clefs privé/publique RSA de 4096 bits sur le client :
$ ssh-keygen -t rsa -b 4096 -C "john.doe@example.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/adminsys/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/adminsys/.ssh/id_rsa.
Your public key has been saved in /home/adminsys/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:U4ONTEK9XsXx42X6ktmdokRPYGYUM5BIt9EFWTjNJeQ john.doe@example.com
The key's randomart image is:
+---[RSA 4096]----+
| .+oo++B%*.. |
| =o=+=*+. |
| +o+*.Eo o|
| ..=... = |
| .S. . .o |
| ... o =o|
| . o+.+|
| . . .. |
| . |
+----[SHA256]-----+
Une passphrase est demandée lors de la génération des clefs.
(optionnel) Pour éventuellement la redéfinir ultérieurement :
$ ssh-keygen -p
(optionnel) Vérification que l’agent SSH est actif :
$ eval $(ssh-agent -s)
Ajouter la clef SSH privée à l’agent SSH :
$ ssh-add ~/.ssh/id_rsa
Identity added: /home/adminsys/.ssh/id_rsa (/home/adminsys/.ssh/id_rsa)
Configuration sur le serveur central GitHub
Settings > SSH ans GPG keys > New SSH key
Copier la clef publique (fichier ~/.ssh/id_rsa.pub) du client vers le serveur GitHub dans le champ prévu.
Valider avec Add SSH Key
Confirmer avec le mot de passe GitHub :
La clef a été ajoutée :
Connexion depuis le client vers le serveur GitHub via SSH
Ajout de la clef publique du serveur GitHub à la liste des hôtes reconnus (la passphrase est requise) :
$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Hi darwinos! You've successfully authenticated, but GitHub does not provide shell access.
Clonage du dépôt avec son lien SSH
$ git clone git@github.com:darwinos/repotest.git
Pour info, en HTTPS le lien serait du type suivant :
https://github.com/darwinos/repotest.git
alors qu’en SSH il est de celui-ci :
git@github.com:darwinos/repotest.git
Lors du premier push, la passphrase définie lors de la génération des clefs est demandée :
$ git push origin master