{"id":21619604,"url":"https://github.com/ekarton/squash-git-commits","last_synced_at":"2026-04-29T09:03:18.391Z","repository":{"id":43401169,"uuid":"371865427","full_name":"EKarton/Squash-Git-Commits","owner":"EKarton","description":"A shell script that allows you to squash your Git commits to a single commit relative to another branch","archived":false,"fork":false,"pushed_at":"2022-03-03T10:14:40.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T11:45:42.110Z","etag":null,"topics":["git","productivity","squash-commits"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/EKarton.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}},"created_at":"2021-05-29T02:50:04.000Z","updated_at":"2021-05-29T04:03:17.000Z","dependencies_parsed_at":"2022-09-10T05:21:32.692Z","dependency_job_id":null,"html_url":"https://github.com/EKarton/Squash-Git-Commits","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EKarton/Squash-Git-Commits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EKarton%2FSquash-Git-Commits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EKarton%2FSquash-Git-Commits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EKarton%2FSquash-Git-Commits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EKarton%2FSquash-Git-Commits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EKarton","download_url":"https://codeload.github.com/EKarton/Squash-Git-Commits/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EKarton%2FSquash-Git-Commits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32418174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["git","productivity","squash-commits"],"created_at":"2024-11-24T23:09:28.582Z","updated_at":"2026-04-29T09:03:18.357Z","avatar_url":"https://github.com/EKarton.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A shell script that squashes your commits to a single commit relative to a main branch\n\nSuppose you are working on a feature branch, and because of context-switching, your feature branch contains lots of temporary commits:\n\n![Branch with WIP commits](./images/unsquashed.svg)\n\nBefore merging your changes to the main branch, you would like to squash all your changes to a single commit:\n\n![Branch with WIP commits](./images/squashed.svg)\n\nWith this shell script, you can run:\n\n```bash\nsquash-commits main 'feat: Add new header'\n```\n\nIt will squash all of your commits to a single commit with the commit message `feat: Add new header` right above the `main` branch!\n\n### Installation:\n\n1. Download the [squash-commits.sh](https://github.com/EKarton/Squash-Git-Commits/blob/main/squash-commits.sh) file to your local computer, and name the file **squash-commits.sh**\n2. Create an alias of this script on your terminal by having:\n\n    ```bash\n    alias squash-commits=\"~/Downloads/squash-commits.sh\"\n    ``` \n    \n    in your `~/.bash_rc` or `~/.zshrc` file\n\n3. Reload your terminal by running ```source ~/.bash_rc``` or ```source ~/.zshrc```\n\n4. Go to your Git repo, check out to your feature branch, and run:\n\n    ```bash\n    squash-commits \u003cbase-branch\u003e \"\u003cyour-commit-message\u003e\"\n    ```\n\n    where:\n    * `\u003cbase-branch\u003e` is the branch you want the single commit to be right above\n    * `\u003cyour-commit-message\u003e` is your commit message from your code changes\n\n### Disclaimer:\n\nI have no responsibility over any damages or loss that may occur during the execution of or usage of my shell script.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekarton%2Fsquash-git-commits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekarton%2Fsquash-git-commits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekarton%2Fsquash-git-commits/lists"}