Code Monkey home page Code Monkey logo

git_diet's Introduction

git_diet

Sometimes you just don't want git to keep absolutely everything that has ever been committed to a repo. Maybe you need to trim down your repo size to put it on github or push it to heroku, or maybe you are just a little OCD. Either way, here's hoping some of the scripts in here can help you.

These scripts have only been tested on Mac OS X. All help very very welcome :D

find_fattest_objects.sh

Shows the largest objects in the git repo of the current directory

find_fattest_objects.sh [-n <number_of_objects>] [-d] [-f]

  OPTIONS
    -n  Show the n largest files in the repo (default 10)
    -d  Filter out files that are currently in the project
    -f  Show file paths only (useful for piping into other scripts)

purge_objects.sh

Purge all history of the given objects from the repo

purge_objects.sh <file>...

  OPTIONS
    file  One or more file paths to purge

Example

To delete the 50 largest objects in your repo that are files that are not in your project anymore

 find_fattest_objects.sh -n50 -d -f | xargs purge_objects.sh 

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.