Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Task Git Essentials

Fenrir ID: git/ess-nib

Task submission

Do not create any merge request! Just push all the branches to the remote repository.

Task description

The task sources are available here. Add this repository as a remote and fetch all branches.

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: the data must be ordered

  • 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 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.

Caution
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 6

You are to work with branch 11. Roll back to commit 21.

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:12 in Rome

Important
Do not create a new commit, just modify the last one.

Part 8

Apply the changes from commit 133 to branch 14. Preserve the message of the commit.

Part 9

When working with scripts in Windows, one can encounter several problems. Assume your collaborator has committed a script win.sh to branch 15 from Windows. Try running it. What happens? Fix all errors so that the script prints HI when executed.

Warning
You must not use dos2unix utility!

Part 10

Assume, we have a project that has two modules: moduleA and moduleB. Both modules share the same dependency deps. To reduce code duplication you have to change the deps directory in moduleB to a link to the same directory in moduleA.

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?

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>

About

Devtools. Task git (essentials)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors