Git
Here is a quiz about “git”.
At the end of the quiz, you’ll see your result. Retry the wrong answer(s) to discover the right one(s).
Warning
If your score is below average, call SED immediately ! 😆. Seriously, please come and talk with us to avoid doing major mistakes.
The button provides some help !
---
primary_color: steelblue
---
## Git
What is Git ?
> Only one answer is valid :wink:
1. [x] a version control system
1. [ ] a nickname for github or gitlab
> Seriously ? :grin:
1. [ ] a remote repository platform
1. [ ] a file sharing protocol
## Git commands
Only 5 git commands exists in this list. Select them.
> 5 on 7... doable :wink:
- [x] init
- [x] stash
- [x] fetch
- [x] mv
- [x] bisect
- [ ] find
- [ ] graph
> ```git log graph``` exist.
## Git tracking
Git automatically adds new files to the repository and starts tracking them.
1. [ ] True
1. [x] False
## Git tracking again
What is the command to start tracking a file ?
1. [x] git add
1. [ ] git commit
1. [ ] git push
## Git pull
Git pull is a combination of:
1. [x] fetch and merge
1. [ ] add and commit
1. [ ] branch and checkout
## Inspect differences
What is the command to show the differences between the current branch and the branch "new-email"?
1. [x] git diff new-email
1. [ ] git log new-email
1. [ ] git status new-email
1. [ ] git changes new-email
## Branching
In Git, a branch is:
1. [x] A separate version of the main repository
1. [ ] A small wooden stick you can use to type command
1. [ ] A secret part of Git config
## Branching again
Select git commands to create and switch to a new branch in this list
> 2 good answers in the list...
- [x] git checkout -b new-branch
- [x] git switch -c new-branch
- [ ] git branch new-branch
## Merge history
Assume the following history exists and the current branch is "main".
```
A---B---C topic
/
D---E---F---G main
```
If there is no merge conflict, what is the resulting history after `git merge topic` ?
1. [x] ```
A---B---C topic
/ \
D---E---F---G---H main
```
1. [ ] ```
A---B---C topic
/
D---E---F---G---A---B---C main
```
## Merge history again
Assume the following history exists and the current branch is "main".
```
A---B---C topic
/
D---E main
```
Which one of the following history is the result of `git merge --ff topic` ?
1. [x] ```
A---B---C topic main
/
D---E
```
1. [ ] ```
A---B---C topic
/ \
D---E-----------F main
```
## Good pratice
Select git good practices in this list
> 2 good answers in the list
- [x] each feature under development is associated with a new branch
- [ ] force push a branch instead of solving merge conflicts
- [x] write descriptive commit messages
- [ ] one commit is one feature
- [ ] the repository should contains all the dependencies (e.g. `node\_modules/`)
The quiz only runs in your browser. Even if your score is bad ! 😉
No personnal datas about you or your score are kept. Only an anonymous ratio is store to help us to build future tutorials.