PHPackages                             gilbitron/laravel-migrate-to-branch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. gilbitron/laravel-migrate-to-branch

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

gilbitron/laravel-migrate-to-branch
===================================

A Laravel Artisan command to rollback migrations before switching to a given branch

1.0.0(8y ago)101.3k5[1 issues](https://github.com/gilbitron/laravel-migrate-to-branch/issues)MITPHP

Since Jun 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gilbitron/laravel-migrate-to-branch)[ Packagist](https://packagist.org/packages/gilbitron/laravel-migrate-to-branch)[ RSS](/packages/gilbitron-laravel-migrate-to-branch/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Laravel migrate:to-branch
=========================

[](#laravel-migrateto-branch)

This is a Laravel Artisan command to rollback migrations before switching to a given branch.

Imagine the scenario where you are working on a feature branch with some new migrations that have been run on the database. Now you want to switch back to the develop branch but you need to rollback the migrations to the state they were on the develop branch. This command makes this process easier by working out which migrations need rolled back and then running the `migrate:rollback` command for you.

**Note:** This command needs run *before* you switch branches.

Install
-------

[](#install)

Require the library by running:

```
composer require gilbitron/laravel-migrate-to-branch

```

Next you need to add the following to your `providers` array in `config/app.php`:

```
Gilbitron\Laravel\MigrateToBranchServiceProvider::class

```

Usage
-----

[](#usage)

Before switching to a different branch run the following command using the name of the destination branch:

```
php artisan migrate:to-branch {branch}

```

If you want to see which migrations need rolled back without actually running the `migrate:rollback` command you can use the `--dry-run` flag.

Credits
-------

[](#credits)

Laravel "migrate:to-branch" was created by [Gilbert Pellegrom](https://gilbitron.me) from [Dev7studios](https://dev7studios.co). Released under the MIT license.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3263d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20011de485eeea26b5582c75daaab217937832762b5d5f551d34d07f74138bb0?d=identicon)[gilbitron](/maintainers/gilbitron)

---

Top Contributors

[![gilbitron](https://avatars.githubusercontent.com/u/203882?v=4)](https://github.com/gilbitron "gilbitron (3 commits)")

---

Tags

gitlaravellaravel-artisan-commandmigraterollback-migrations

### Embed Badge

![Health badge](/badges/gilbitron-laravel-migrate-to-branch/health.svg)

```
[![Health](https://phpackages.com/badges/gilbitron-laravel-migrate-to-branch/health.svg)](https://phpackages.com/packages/gilbitron-laravel-migrate-to-branch)
```

###  Alternatives

[slimkit/plus

The Plus(ThinkSNS+) is a powerful, easy-to-develop social system built with Laravel.

2.2k2.4k](/packages/slimkit-plus)[laravel-fans/docker

Full Laravel production environment for Docker

4311.3k](/packages/laravel-fans-docker)[downtoworld/laravel-devops

Laravel Cloudflare-Tunnels Ready Production Docker-Compose

161.1k](/packages/downtoworld-laravel-devops)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
