Coder Social home page Coder Social logo

split-with-history's Introduction

Split With History

Do you have monstrous files with lots of classes in your repository, but you are afraid to split them because you don't want to lose git change history?

This is a PowerShell script that allows to extracts a line range from the specified file into another file, preserving git history for both the original file and the extracted bit.

Example usage:

splitwithhistory -s 20 -e 70 -p 'AC-82445' -o 'ManyClasses.cs' -t 'SingleClass.cs'

Parameters

  • -s or -start - the number of the first line (inclusive) to be extracted to a separate file. Required.
  • -e or -end - the number of the last line (inclusive) to be extracted to a separate file. Required.
  • -p or -commitPrefix - optional prefix of the automatic commits that will be made in the git repository.
  • -o - the source file name, from which the specified line range will be extracted. Required.
  • -t - the target file name, to which the specified part of the source file will be extracted. Required.
  • -tr - optional new name for the source file.
  • -b1 - optional name of the first temporary branch that will be used to create a necessary merge conflict. By default, equals splitwithhistorytemporaryhistorybranch1.
  • -b2 - optional name of the first temporary branch that will be used to create a necessary merge conflict. By default, equals splitwithhistorytemporaryhistorybranch2.

Words of caution

The branches specified by the -b1 and -b2 parameters will be created and deleted automatically.

split-with-history's People

Contributors

wh1t3cat1k avatar

Watchers

James Cloos avatar  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.