-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_04_ComparingAndRevertingChanges.yaml
77 lines (75 loc) · 4.18 KB
/
git_04_ComparingAndRevertingChanges.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
categoryId: 8266 # CATEGORY NAME
name: Comparing and reverting changes
questions:
- description: Which information is shown with the command 'git status'?
choices:
- It shows if the repository is in a stable state
- It shows the current status of the repository and possible actions which can be performed
- It shows the current status of the repository and the changes compared to the remote repository
- It shows if a connection to the repository can be established or if networks exists
hint:
explanation: It shows which files have changed, which are staged and which are not part of the staging area. It also shows which files have merge conflicts and gives an indication what the user can do with these changes, e.g., add them to the staging area or remove them, etc.
correctChoice: 1
- description: Is it possible to compare changes between commits?
choices:
- Yes, but only if the commits are still in the staging area
- Yes, but only if the commits are already pushed to the repository
- Yes, with the command 'git diff commit_ref1 commit_ref2'
- No, this is not possible
hint:
explanation: The git diff command allows you to compare changes between commits, the staging area and working tree, etc.
correctChoice: 2
- description: Why could the history of a git repository be of interest?
choices:
- Because you can then know since when it is hosted on GitHub
- Because it can be used to indentify which change was introduced by which commit
- Because you can see who is the parent of the repository
- In good coordinated teams, the history is not relevant, because everyone knows what the others did
hint:
explanation: The git log command shows the history of the Git repository. If no commit reference is specified it starts from the commit referred to by the HEAD pointer.
correctChoice: 1
- description: What does the command 'git blame' do?
choices:
- It starts a cyber mobbing attack
- It classifies the git repository as useless and allows to rebuild the Git commit history
- It removes the Git repostory from the web server
- It allows you to see which commit and author modified a file on a per line base
hint:
explanation: This is very useful to identify the person or the commit which introduced a change.
correctChoice: 3
- description: Is it possible to delete untracked files?
choices:
- Yes, with the command 'git clean -fdx'
- No, what happens in git stays in git
- Yes, but they will still be visible in the history and can be restored
-
hint:
explanation: All untracked files are removed if you run this command. You will not be able to restore them, as they are not part of your Git repository.
correctChoice: 0
- description: On which tracked files can you revert uncommited changes?
choices:
- On no files, because the changes are still uncommited
- On all files which have a special tag on them
- On all files
-
hint:
explanation: You can always recreate the file content of tracked files, based on the staging area or based on a previous commit. You can also remove staged changes from the staging area to avoid that these changes are included in the next commit.
correctChoice: 2
- description: What does the command 'git reset' do?
choices:
- It deletes all changes done to a repository
- It allows to manually set the current HEAD pointer to a specified commit
- It deletes the history of the repository
-
hint:
explanation: This is for example useful to undo a particular change or to build up a different commit history.
correctChoice: 1
- description: Is it possible to undo changes done by a commit while keeping the original commit in the history?
choices:
- No, once commited it can not be withdrawn
- Yes, with the command 'git reset commit_id'
- Yes, with the command 'git clean commit_id'
- Yes, with the command 'git revert commit_id'
hint:
explanation: This command reverts the changes of a commit. Such commits are useful to document that a change was withdrawn.
correctChoice: 3