{"id":17037148,"url":"https://github.com/bast/git-rebase-squash-exercise","last_synced_at":"2025-04-09T20:06:55.312Z","repository":{"id":45664620,"uuid":"75855273","full_name":"bast/git-rebase-squash-exercise","owner":"bast","description":"Git rebase and commit squashing exercise.","archived":false,"fork":false,"pushed_at":"2024-03-11T20:50:26.000Z","size":62,"stargazers_count":10,"open_issues_count":2,"forks_count":261,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:06:41.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-07T16:36:13.000Z","updated_at":"2024-05-05T14:30:12.000Z","dependencies_parsed_at":"2024-11-07T13:00:39.826Z","dependency_job_id":"1883b3cd-601a-4a59-ace2-ed4c0f98f396","html_url":"https://github.com/bast/git-rebase-squash-exercise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fgit-rebase-squash-exercise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fgit-rebase-squash-exercise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fgit-rebase-squash-exercise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fgit-rebase-squash-exercise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bast","download_url":"https://codeload.github.com/bast/git-rebase-squash-exercise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T08:52:59.086Z","updated_at":"2025-04-09T20:06:55.291Z","avatar_url":"https://github.com/bast.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n## Git rebase and commit squashing exercise\n\n### Objective\n\nIn this exercise we will practice how to squash incomplete commits into one\nnice commit and replay it on top of the master branch.\n\n\n### Motivation\n\nThis technique is useful in situations where you need to make changes to a pull\nrequest before it can be integrated.\n\n\n### Exercise\n\nStart the exercise by forking and cloning the repository.\n\nThe `haiku` branch represents a feature branch that is to be rebased (moved) and squashed.\n\nOn the `haiku` branch you find a script that prints a haiku:\n\n```shell\n$ python main.py\n\nThis is our haiku:\n\nOn a branch ...\n                  by Kobayashi Issa\n\n              On a branch\n              floating downriver\n              a cricket, singing.\n```\n\nThe haiku is great but the\ncommit history on\nthe `haiku` branch is not (on purpose):\n\n```shell\n$ git log --oneline\n\n65870f9 fix a copy-paste error\n47a007d completed the haiku\na3278e3 another incomplete commit\n54fba21 startign to work on it (commit with a typo)\n3ff39a1 forgot to add a file\n7e1f903 starting working on the haiku\nc50a463 initial commit\n```\n\nYour task is to rebase the `haiku` branch on top\nof `master` and squash the several small \"incomplete\" commits into one single\nself-contained cherry-pickable commit.\n\nIn other words instead of this history:\n\n![alt text](https://github.com/bast/git-rebase-squash-exercise/raw/master/img/rebase-exercise-1.jpg \"Exercise step 1\")\n\nwe wish to arrive at this history:\n\n![alt text](https://github.com/bast/git-rebase-squash-exercise/raw/master/img/rebase-exercise-3.jpg \"Exercise step 3\")\n\nby first rebasing the commits:\n\n![alt text](https://github.com/bast/git-rebase-squash-exercise/raw/master/img/rebase-exercise-2.jpg \"Exercise step 2\")\n\nand later squashing them.\n\nVerify the history and also that the script still works after the operation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fgit-rebase-squash-exercise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbast%2Fgit-rebase-squash-exercise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fgit-rebase-squash-exercise/lists"}