git Flashcards

1
Q

comment init un nouveau repo git ?

A

git init –initial-branch=main

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

comment lier un repo local à un dépot distant ?

A

git remote add origin https://…

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

comment consulter les logs git ?

A

git log

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

que fait la commande git status ?

A

Elle vous informe sur les modifications locales par rapport au dépôt, y compris les fichiers suivis, non suivis, ou en conflit.

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

que fait la commande git diff commit1 commit2 ?

A

compare le commit1 et commit2, met en vert les lignes rajouté et en rouge les lignes retiré dans chaque fichier modifié.

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

git revert <last></last>

A

Crée un nouveau commit qui annule les changement du commit renseigné

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

comment on peut annuler des modifications dans un fichier ?

A

git restore
si jamais on a git add avant :
git restore –staged

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

comment mettre nos modifications de côté ?

A

git stash : mettre de côté
git stash list : lister les stash

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

git stash pop

A

une commande qui permet de revenir sur les modifications d’un fichier

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