Skip to content

git-automerge/php-automerge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoMerge

AutoMerge is a CLI tool to automate merging multiple remote Git branches into a temporary branch, tagging that branch with an environment-specific tag, pushing the tag to origin, and cleaning up afterward.


Features

  • Reads configuration from a YAML file defining multiple environments
  • Supports wildcard patterns for included remote branches to merge
  • Creates a temporary branch from a base branch before merging
  • Tags the merge commit with an environment name and timestamp
  • Pushes the tag to the remote repository
  • Automatically cleans up the temporary branch and local tag
  • Supports optional customizable tag prefix per environment

Installation

Install via Composer:

(Optional) Add post script to create symlink

"scripts": {
  "post-install-cmd": [
    "[ -L automerge ] || ln -s vendor/bin/automerge automerge"
  ],
  "post-update-cmd": [
    "[ -L automerge ] || ln -s vendor/bin/automerge automerge"
  ]
}
composer global require git-automerge/php-automerge

(Optional) create symlink

ln -s vendor/bin/automerge automerge

Usage

vendor/bin/automerge

Configuration Example (automerge-config.yaml)

Create a automerge-config.yaml file in your project root with this structure:

staging:
  base: main
  branches:
    - "bugfix/*"
  tag_prefix: "prod-"      # Optional; Default is "automerge-" if empty or false, no prefix used

feature:
  base: develop
  branches:
    - "feature/*"
  tag_prefix: false # omitted here; no prefix will be used

The script will:

  • Check your working directory is clean.
  • Fetch all remote branches.
  • Create a temporary branch from the base branch.
  • Merge all matching remote branches.
  • Tag the commit with a timestamp and environment name.
  • Push the tag to the remote.
  • Clean up local temporary branch and tag, and restore your original branch.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages