Git Essentials
This is a README.adoc file. The original repository is located here.
Task Git Essentials
Fenrir ID:
git/ess-nib
Points:80
Task submission
Do not create any merge request! Just push all the branches to the solution repository.
The task sources are available here. Add this repository as a remote and fetch all branches.
Tests check each commit’s hash: do not create any extra commits unless it is stated. Use detached mode to check out to the required branch and create a local branch from the commit you’ve switched to.
Each part adds 8 points to the final score.
Task description
Part 1
Merge branch 2 into branch 1. A merge conflict must occur. Resolve it as follows:
-
Delete a file that was removed in one of the branches
-
Preserve all changes in the other file: combine the changes so that the lines are ordered alphabetically
-
Merge-commit’s message must be
3
Part 2
Assume branch 3 is main and you are developing a feature on branch 4. You have already merged several changes from 4 by other collaborators and now the feature is finally ready. You have to rebase the branch 4 on top of the branch 3. The resulting commit’s message must be 4.
Part 3
We have previously dealt with different types of merge conflicts. However, not all types have been covered. That is why you have to create a merge conflict of a new type yourself.
Using branch 6, create a merge conflict that occurs after running git merge 6 on branch 5.
Part 4
You have to rebase branch 9 onto branch 7. Branches 8 and 9 store independent changes to branch 7 that is why you must modify branch 9 only. Read man pages to find out how to achieve this goal.
| No merge conflicts are expected to occur! |
Part 5
You are to work with branch 10. By creating a new commit, undo the changes brought by commit 11. Find the most suitable command and change neither the commit’s default message nor its body.
Part 7
You are to work with branch 12. Fix the script so that it prints 0_0. Moreover, change the commit’s metadata:
-
Message:
12: fixed -
Author name:
Snusmumriken -
Author email:
snus@mumij.troll -
Date and time:
12 December 2012 12:12:12in Rome
| Do not create a new commit, just modify the last one. |
Questions
-
What is the difference between a merge and a merge request?
-
Why have merge conflicts occurred in several parts?
-
How can one distinguish a merge from a rebase?
-
What are the file modes in git?
-
You’ve managed to turn time back in part 7. Is it the same in GitLab? Why?
-
What was wrong with Windows in part 9?
Copyright
The project is licensed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
© 2026-present Iwan Kalinin <koefic.cien@gmail.com>