You are writing user documentation for a product. You have already written documentation for a few new features, each in a separate branch. You have merged the feature-search branch.
gitGraph BT: commit id: "Add features.md" commit id: "Mention feature for creating books" tag: "v10" branch feature-search branch feature-delete branch list checkout feature-delete commit id: "Mention feature for deleting books" checkout feature-search commit id: "Mention feature for searching books" checkout feature-delete commit id: "Add missing period" checkout main commit id: "Fix phrasing of heading" checkout feature-search commit id: "Add more details on the search feature" checkout list commit id: "Add partial docs for listing books" checkout main merge feature-search id: "Merge search feature"
At this point, you realise this way of merging can result in a complicated revision graph. Instead, you wish to merge these changes in a way that results in a simple linear revision graph.
Undo the merging of feature-search.
Squash-merge the feature-search branch onto the main branch with the commit message Add the search feature. Delete the feature-search branch.
Similarly, squash-merge and delete the feature-delete branch with the commit message Add the delete feature, while resolving any merge conflicts -- in the features.md, the delete feature should appear after the search feature (expected content given below):
# Features
## Creating Books
Allows creating one book at a time.
## Searching for Books
Allows searching for books by keywords.
Works only for book titles.
## Deleting Books
Allows deleting books.
The list branch is not needed, as you have decided not to have that feature. Delete that branch.
The resulting revision graph should be as follows:
gitGraph BT: commit id: "Add features.md" commit id: "Mention feature for creating books" tag: "v10" commit id: "Fix phrasing of heading" commit id: "Add the search feature" commit id: "Add the delete feature"
mix-messy-graphTo download the exercise:
gitmastery-exercises folder.gitmastery download mix-messy-graph command.Scenario:
You are writing user documentation for a product. You have already written documentation for a few new features, each in a separate branch. You have merged the feature-search branch.
gitGraph BT: commit id: "Add features.md" commit id: "Mention feature for creating books" tag: "v10" branch feature-search branch feature-delete branch list checkout feature-delete commit id: "Mention feature for deleting books" checkout feature-search commit id: "Mention feature for searching books" checkout feature-delete commit id: "Add missing period" checkout main commit id: "Fix phrasing of heading" checkout feature-search commit id: "Add more details on the search feature" checkout list commit id: "Add partial docs for listing books" checkout main merge feature-search id: "Merge search feature"
At this point, you realise this way of merging can result in a complicated revision graph. Instead, you wish to merge these changes in a way that results in a simple linear revision graph.
Your task:
Undo the merging of feature-search.
Squash-merge the feature-search branch onto the main branch with the commit message Add the search feature. Delete the feature-search branch.
Similarly, squash-merge and delete the feature-delete branch with the commit message Add the delete feature, while resolving any merge conflicts -- in the features.md, the delete feature should appear after the search feature (expected content given below):
# Features
## Creating Books
Allows creating one book at a time.
## Searching for Books
Allows searching for books by keywords.
Works only for book titles.
## Deleting Books
Allows deleting books.
The list branch is not needed, as you have decided not to have that feature. Delete that branch.
The resulting revision graph should be as follows:
gitGraph BT: commit id: "Add features.md" commit id: "Mention feature for creating books" tag: "v10" commit id: "Fix phrasing of heading" commit id: "Add the search feature" commit id: "Add the delete feature"
To verify your work:
gitmastery-exercises/mix-messy-graph folder (or any sub-folder of it).gitmastery verify command.To reset the exercise and start over, navigate to the gitmastery-exercises/mix-messy-graph folder and run the gitmastery progress reset command.