This repository provides you with practice of all of the git skills you have learned. The topics that are tested in this exercise are:
- Committing new and existing files
- Create commits that contains only specific files
- Ignoring files
- Finding the status of files in the working directory.
- Moving and removing files
- Using the repository log
- Creating and merging branches
- Resolving merge conflicts
- Tagging
Fork this repository and complete the following steps within a clone.
In this exercise we'll continue the creation of a book. The book is partly written. Each chapter is a file within the files\chapters
. To keep track of the plot and characters there are files within the files\structure
folder.
Run gitruler to set up the exercise.
- Our author has completed writing chapter 5 and started chapter 6 but didn't commit them. Commit chapter 5 with the message "Chapter 5 complete".
- Finish chapter 6 by adding the final word "headache". Commit that file with the message "Chapter 6 complete".
- The author started chapter 7 but never committed it. We decided that it's not good. Delete it from the working directory.
Our author thought that factual information at the end of the novel would make it interesting. He added an appendix-a in the chapters folder. Our publisher doesn't like the idea.
- Delete appendix-a from git and tell git to ignore all files in the chapter folder that start with appendix. Commit both of these changes with the message 'Ignore appendices'.
We decide to split the book into 2, so we can sell more books.
Create new folders so that the structure looks like this:
files/
├── books/
│ ├── book-1/
│ │ └──chapters
│ └── book-2/
│ └──chapters
└── structure/
Before we make this big change, tag the latest commit with the name "one-volume-version"
Move chapters 1, 2 and 3 into book-1 and chapters 4, 5 and 6 into book-2. Commit all of this with the message "Create two books".
Tag this latest commit with the name "two-volume-version".
The publisher wants to experiment with a more exotic version of the books while the current version is being printed.
- Create a branch called "exotic".
- In this branch change
car
toice-cream van
in chapter 4. - Commit this change with the message "Change book to exotic".
Meanwhile we realise, just before the book is printed, that Grant never learned to drive and so we need to remove references to his car from the book.
- Back on the master branch, remove the first line (and the following empty line) from the start of chapter 4. Commit this with the message "Remove the car".
Now we're ready to publish the exotic version.
- From the master branch merge in the exotic branch.
- Oh dear, a merge conflict. Resolve this to keep the line about the ice-cream van. Commit this with the message "Keep Ice-cream".
Once the exercise is complete, push this repository to the remote. If there are multiple branches or tags for an exercise, make sure that you push them all.
To ensure that you have you correctly pushed everything that you need to, you could clone the remote repository into a separate folder and re-run gitruler.