Commit 31cee192 authored by Sylvain Arreckx's avatar Sylvain Arreckx
Browse files

Initial release

parents
<img src="img/lewagon.png" class="as-is" height="50" />
# Starting with Git
##(and Github)
[
{
"filename": "index.md",
"attr": {
"data-background": "http://25.media.tumblr.com/b03e53931e2264f97a3e93beae6d3053/tumblr_mtw7hple1a1st5lhmo1_1280.jpg"
}
},
{
"filename": "part-2-git-intro.md",
"attr": {
"data-background": "http://farm5.staticflickr.com/4122/4735516686_62ae6eb0f8_b.jpg"
}
},
{
"filename": "part-3-installation.md",
"attr": {
"data-background": "http://farm7.staticflickr.com/6128/5932561907_c325e9b981_b.jpg"
}
},
{
"filename": "part-4-first-repo.md",
"attr": {
"data-background": "img/dark.jpg"
}
},
{
"filename": "part-5-branches.md",
"attr": {
"data-background": "img/dark.jpg"
}
},
{
"filename": "part-6-remote.md",
"attr": {
"data-background": "img/dark.jpg"
}
},
{
"filename": "part-7-github-pages.md",
"attr": {
"data-background": "img/dark.jpg"
}
},
{
"filename": "part-8-thanks.md",
"attr": {
"data-background": "http://24.media.tumblr.com/da6bdeb8f4e2e4104b539e5ad755c1cf/tumblr_muuhikhivh1st5lhmo1_1280.jpg"
}
}
]
<img src="img/git_logo.png" class="as-is" />
note:
Put your speaker notes here.
You can see them pressing 's'.
## Origin
![](img/linus.jpg)
Designed and implemented in 2005 by **Linus Torvalds**
![](img/git_definition.png)
note:
I'm an egotistical bastard, and I name all my projects after myself.
First Linux, now git.
## Décentralisé
## Rapide
## Performant
# Installation
<img src="img/github_app.png" class="as-is" height="300" />
[mac.github.com](http://mac.github.com) ou [windows.github.com](http://windows.github.com)
note:
Les participants téléchargent le logiciel Github + installation.
## Configuration
```shell
$ git config --global user.name "Sebastien Saunier"
$ git config --global user.email "seb@saunier.me"
$ git config -l
```
## Prêt ?
```shell
$ git --version
# git version 1.8.5
```
\ No newline at end of file
# Les bases
## Mon premier dépôt
```shell
$ git init
$ git status
$ git add
$ git diff
$ git commit
$ git log
```
note:
Voici les commandes que nous allons apprendre
## Nouveau projet : Listes
<div class="fragment">
Créer l'espace de travail
```shell
$ cd
$ mkdir workspace
$ cd workspace
```
<div class="fragment">
Puis le dossier du nouveau projet
```shell
$ mkdir listes
$ cd listes
$ git init
```
## Nouveau fichier
Créer le fichier `courses.txt`
<div class="fragment">
```shell
$ git status
```
<div class="fragment">
```shell
$ git add courses.txt
$ git status
```
<div class="fragment">
```shell
$ git commit -m "Creation de la liste de courses"
$ git status
```
note:
Pas besoin de serveur, pas besoin de connexion Internet
## Modification de fichier
Modifier le fichier `courses.txt`
<div class="fragment">
```shell
$ git status
```
<div class="fragment">
```shell
$ git diff courses.txt
```
<div class="fragment">
```shell
$ git add courses.txt
$ git status
```
<div class="fragment">
```shell
$ git commit -m "Ajout du beurre"
$ git status
```
<div class="fragment">
```shell
$ git log
```
## Que s'est-il passé ?
## Espace de travail
_working directory_
```shell
$ git status
# Changes not staged for commit:
```
## Zone de transit
_index_ ou _staging area_
```shell
$ git status
# Changes to be commited:
```
<img src="img/git-0-start.png" class="as-is" />
<img src="img/git-1-dirty.png" class="as-is" />
<img src="img/git-2-add.png" class="as-is" />
<img src="img/git-3-commit.png" class="as-is" />
## Et dans l'autre sens ?
<img src="img/git-1-dirty.png" class="as-is" />
<img src="img/git-4-checkout.png" class="as-is" />
<img src="img/git-2-add.png" class="as-is" />
<img src="img/git-5-reset.png" class="as-is" />
## Rinse and Repeat
\ No newline at end of file
# Branches
Expérimentez en toute sécurité
<img src="img/branch-0-master.png" class="as-is" />
## Une branche = Une fonctionnalité
```shell
$ git checkout -b noel
```
<img src="img/branch-1-checkout-b.png" class="as-is" />
## Navigation
Lister les branches
```shell
$ git branch
```
Se positionner dans une branche
```shell
$ git checkout <branch_name>
```
```shell
$ git commit
```
<img src="img/branch-2-commit.png" class="as-is" />
## Fusion
### En anglais, _merge_
```shell
$ git checkout master
$ git diff master..noel
$ git merge noel
```
<img src="img/branch-3-merge.png" class="as-is" />
## Nettoyage
```shell
$ git branch -d noel
```
<img src="img/branch-4-br-d.png" class="as-is" />
# Remote
Parlons de dépôt *distant*
<img src="img/remote-0-master.png" class="as-is" />
<img src="img/remote-1-remote.png" class="as-is" />
## Héberger un dépôt distant ?
Github (Ou [BitBucket](https://bitbucket.org/))
## Ajouter une _remote_
```shell
$ git remote add origin git@github.com:<user>/<proj>.git
$ git remote -v
```
```shell
$ git push origin master
```
<img src="img/remote-2-push.png" class="as-is" />
## Récupérer les changements
```shell
$ git checkout master # Aller sur la branche master
$ git status # Est-ce propre? (Bien sûr!)
$ git pull origin master # Récupérer le travail
# de l'équipe
```
## _Sync Branch_
Terminologie de l'application GitHub
## Conflits
## Pull Requests
Ou comment utiliser GitHub pour vos revues de code
## Fork
Contribuez à l'open source
\ No newline at end of file
# GitHub Pages
Ou comment héberger **gratuitement** votre portfolio
Même s'il génère 1M de pages vues!
## Dépôt magique
`<user>.github.io`
`master => http://<user>.github.io/`
## Branche magique
Tous les autres dépôt GitHub:
`gh-pages => http://<user>.github.io/<repository>/`
## Action!
Un simple fichier `index.html` suffit :)
## Marque blanche
`http://<user>.github.io => http://your.domain`
Utilisez un fichier `CNAME` à la racine du dépôt.
[Détails](https://help.github.com/articles/setting-up-a-custom-domain-with-pages)
Exemple: [ssaunier.github.io/CNAME](https://github.com/ssaunier/ssaunier.github.io/blob/master/CNAME)
\ No newline at end of file
# Merci!
### Laurent Heirendt
![](https://avatars0.githubusercontent.com/u/20812112?v=3&s=180)
### Sylvain Arreckx
![](https://avatars1.githubusercontent.com/u/816318?v=3&s=180)
Cheat sheet : [Web](http://rogerdudler.github.io/git-guide/index.html) or [PDF](http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf) prepared by [@rogerdudler](https://github.com/rogerdudler)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment