GIT Flashcards

1
Q

Commencer à suivre les versions dans un dossier

A

Git init

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Pour ajouter un fichier à suivre avec git

A

Git add file1
git commit -m “premier commit”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Voir la liste des commit d’un dossier

A

git log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Savoir où on en est des commit dans un dossier

A

git status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Ajouter tous les fichiers du dossier en cours

A

git add -A
git commit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

3 types de propriétés dans git

A

Système==> tous les utilisateurs
Global==> tous les dossiers git d’un utilisateur
local==> le seul dossier en cours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Si une propriété est définie au niveau local et aussi au niveau global, laquelle a la priorité ?

A

Cell définie au niveau local

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Comment définir un nom d’utilisateur au niveau local ?

A

git config –local user.name “toto”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Comment voir la liste de toutes les propriétés ?

A

git config –list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Comment lister les branches d’un projet ?

A

git branch -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Comment créer une branche test et se déplacer sur la nouvelle branche ?

A

git checkout -b ‘test’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Comment se déplacer sur la branche master?

A

git checkout ‘master’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Comment supprimer une branche ?

A

git branch -d test_branche

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Comment initier un répertoire de partage git?

A

git init –bare

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Comment dire à git qu’un répertoire de partage existe pour mon dossier git ?

A

git remote add origin../remote_folder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Comment afficher les répertoires remote de mon répertoire git actif ?

A

git remote -v

17
Q

afficher le contenu d’un commit particulier

A

git show 25de9

si 25de9 est le debut du SHA du commit à annuler

18
Q

Comment stocker des modifications qu’on ne veut pas commit ?

19
Q

Comment récupérer le dernier objet stashé

A

git stash apply

20
Q

comment annuler un commit?

A

git revert 25de9

si 25de9 est le debut du SHA du commit à annuler