Git Product home page Git Product logo

cleanup-sh's Introduction

Cleanup.sh - Clean up your Git repositories

This is a script to interactively rebase all feature branches and then safely get rid of them after they are fully merged.

Usage

Inside the git repo:

bash ./cleanup.sh [branch...]

If branch is unspecified, the script operates on all branches other than the main branch.

Operation

The script goes branch by branch, and:

  1. Displays the top commit of the branch, then asks whether to attempt a rebase of the branch. Say y to rebase, n to skip, D to force delete the branch.
  2. Rebases the branch on top of the main branch. If the rebase fails, the script exits allowing you to fix conflicts and continue.
  3. If rebase succeeds, it displays the new top commit of the branch, which will be the top commit of the main branch if the feature branch is obsolete. Say y to (safely) delete the feature branch, n to delete.

Notes

The script assumes that the main remote is called origin, and the main branch is either master or main.

cleanup-sh's People

Contributors

gcampax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.