Gitbash-NPZ

Tasks studies - laboratory

View project on GitHub

TASK02

Task 1.

Create a folder named after your name and surname, inside it there are local, local2 and remote folders.

Task 2.

Go to the local folder and create a new GIT repository there.

Task 3.

Go to the remote folder and create a clean remote repository with the command: git init —bare.

Task 4.

Go back to local and create a file called Cebula.txt and put the text in it (Polish characters are not necessary):

Co innego cebula.
Ona nie ma wnętrzności.
Jest sobą na wskroś cebula
do stopnia cebuliczności.
Cebulasta na zewnątrz,
cebulowa do rdzenia,
mogłaby wejrzeć w siebie
cebula bez przerażenia.

Task 5.

Add a new file to the repository and commit with the description “onion”.

Task 6.

Set the ../remote folder as the remote repository.

Task 7.

“Push” the current version of the repository contained in the local folder to the remote one.

Task 8.

Declare GIT not to include .doc files in the repository and save this change with the description “ignore .doc”.

Task 9.

Create a garbage.doc file with the following content: “there’s nothing interesting here.”

Task 10.

Save the log of changes in the repository in the log.txt file, then add it to the repository and save it with the description “logs”.

Task 11.

Update the remote repository.

Task 12.

Replace the words “onion” with “carrot” in the Onion.txt file.

Task 13.

Generate a file called roznica.txt containing the differences from the original file.

Task 14.

Navigate to the local2 directory and clone the contents of the remote repository to it.

Task 15.

Add another verse to the Cebula.txt file (in the local2/remote directory):

W nas obczyzna i dzikość
ledwie skórą przykryta,
inferno w nas interny,
anatomia gwałtowna,
a w cebuli cebula,
nie pokrętne jelita.
Ona wielekroć naga,
do głębi itympodobna.

Task 16.

Save the changes locally with the description “second verse” and then send them to remote.

Task 17.

Return to the local folder and save only the onion.txt file with the description “carrot” to the local repository.

Task 18.

Create a new branch “carrot”.

Task 19.

While still in master, send changes to remote - this requires resolving the conflict. The first verse with “carrots” and the second original verse are to remain in Cebula.txt. Leave the commit description as default.

Task 20.

Go to the newly created branch “carrot” and after the first stanza add a new line “Long live the carrot!”

Task 21.

Add the file roznica.txt and cebula.txt in the new version to the repository in a new branch with the description “carrot’s birthday” and send to remote.

Task 22.

Return to master branch.

Task 23.

What file is missing and why, place the explanation in the file wyjaszanie.txt and save it in the repository with the description “explanation”.

Task 24.

Unmerge the Cebula.txt file and return it to its state of two verses without carrots.

Task 25.

Add the third verse, save it and send it to remote:

Byt niesprzeczny cebula,
udany cebula twór.
W jednej po prostu druga,
w większej mniejsza zawarta,
a w następnej kolejna,`
czyli trzecia i czwarta.
Dośrodkowa fuga.
Echo złożone w chór.

Task 26.

Go to the local2/remote folder and add “Ah, that onion!” at the end of the file.

Task 27.

Pack the entire folder named after your name and surname and upload it to Moodle.