{"id":16743914,"url":"https://github.com/unguiculus/merge-pull","last_synced_at":"2025-04-10T13:40:37.373Z","repository":{"id":147749523,"uuid":"64469026","full_name":"unguiculus/merge-pull","owner":"unguiculus","description":"Python script for merging pull requests","archived":false,"fork":false,"pushed_at":"2018-03-02T17:49:26.000Z","size":16,"stargazers_count":11,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:21:27.086Z","etag":null,"topics":["merge","pullrequest","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unguiculus.png","metadata":{"files":{"readme":"readme.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-29T09:34:38.000Z","updated_at":"2024-04-27T16:38:51.000Z","dependencies_parsed_at":"2023-05-27T10:15:14.388Z","dependency_job_id":null,"html_url":"https://github.com/unguiculus/merge-pull","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/unguiculus%2Fmerge-pull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unguiculus%2Fmerge-pull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unguiculus%2Fmerge-pull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unguiculus%2Fmerge-pull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unguiculus","download_url":"https://codeload.github.com/unguiculus/merge-pull/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225937,"owners_count":21068087,"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":["merge","pullrequest","python","python3"],"created_at":"2024-10-13T01:41:57.961Z","updated_at":"2025-04-10T13:40:37.364Z","avatar_url":"https://github.com/unguiculus.png","language":"Python","readme":"= Python script for merging pull requests\n:tip-caption: :bulb:\n\nOne of the projects I'm working on uses Bitbucket Cloud. Changes are made via pull requests. Unfortunately, Bitbucket\nonly does non-fastforward merges when you merge a pull request via web interface, even if it is only one commit that\nneeds to be merged. There is no rebase or squash option. We don't like this because it clutters up the history with\nlots of unnecessary merge commits that do not add any value. There may be cases when you want to merge a series\nof commits explicitly, but most of the time, this is not what we want. We prefer to have a nice and mostly linear\nhistory.\n\nYou can work around this limitation by pushing the feature branch the pull request was created from directly to the\ntarget branch. Bitbucket recognizes this and closes the pull request automatically. This also gives us rebase and\nsquash options. We create pull requests, keep committing on them until everything is nice and polished, and then squash\nthe feature branch and force-push the squashed commit to the feature branch and the target branch.\n\nWhile the script was originally developed for Bitbucket Cloud, it can be used for Github as well. The same principles\napply.\n\nTIP: *Update:* +\nMeanwhile, Bitbucket has a squash option. What it still lacks is an option to rebase and merge without squashing,\nwhich would then be a fast-forward merge without merge commit.\n\n== Features\n\n* Rebase and merge pull requests optionally squashing commits\n* When squashing commits, the scripts optionally finds the message of the first commit on the pull request and uses\n  that for the squashed commit\n* After merging, the script switches to the target branch and optionally deletes the feature branch\n  (locally and on the remote)\n* Never creates a merge commit. If you want that, use Github's or Bitbucket's standard workflow\n* Tested to work with Bitbucket Cloud and Github\n\n== Python Compatibility\n\nThe script uses Python 3 by default but is compatible with Python 2.7.\n\n== Usage\n\n[source]\n----\n$ merge_pull.py --help\nusage: merge_pull.py [-h] [--target-branch TARGET_BRANCH] [--remote REMOTE]\n                     [--message MESSAGE] [--assume-yes] [--no-squash]\n\nMerges a pull request. Multiple commits are squashed by default (may be turned\noff). The commits are then rebased on top of upstream changes and pushed\ndirectly to the feature branch and the target branch. This automatically marks\nthe pull request as merged. The script then switches to the target branch and\noptionally deletes the feature branch.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --target-branch TARGET_BRANCH, -t TARGET_BRANCH\n                        The target_branch of the pull request (default:\n                        master)\n  --remote REMOTE, -r REMOTE\n                        The name of the remote (default: origin)\n  --message MESSAGE, -m MESSAGE\n                        If commits need to be squashed, a commit message for\n                        the final commit is required. You will be prompted to\n                        re-use the message of the first commit on the feature\n                        branch. You may then decide to enter a different\n                        message (default: None)\n  --assume-yes, -y      Automatic yes to prompts (default: False)\n  --no-squash, -n       Do not squash commits (default: False)\n----\n\n\n== License\n\n[source]\n----\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n----\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funguiculus%2Fmerge-pull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funguiculus%2Fmerge-pull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funguiculus%2Fmerge-pull/lists"}