Code Monkey home page Code Monkey logo

cpdiff's Introduction

Copy your fresh codes to anywhere in a handy way!

How it works?

copydiff use git diff to find out those files you modified, then copy these files to anywhere you want!

How to use?

Install

python setup.py install

$ cpdiff -h
usage: __main__.py [-h] [-p] [-s START] [-e END] -o OUT [-r ROOT]

Copy files need to be update between commits.

optional arguments:
  -h, --help            show this help message and exit
  -p, --preview         Preview mode.
  -s START, --start START
                        Start from commit(default:HEAD~1).
  -e END, --end END     End commit(default:HEAD).
  -o OUT, --out OUT     Path the files should be copied to.
  -r ROOT, --root ROOT  Path prefix to strip off(default:factory).
  • By default copydiff compares last one commit to filter files.

      $ cpdiff -o 'C:\yourpath'
    
      equals
    
      $ cpdiff -s HEAD~1 -e HEAD -o 'C:\yourpath'
    
      or use commit sha1
    
      $ cpdiff -s {commit-sha1} -e HEAD -o 'C:\yourpath'
    
  • Compare to last 6 commit.

      $ cpdiff -o 'C:\yourpath' --start HEAD~6
    
  • Preview what will be copied.

      $ cpdiff -o 'C:\yourpath' --start HEAD~6 --preview
    
      [{'dst': WindowsPath('C:/yourpath/commit3'), 'src': WindowsPath('commit3')},
      {'dst': WindowsPath('C:/yourpath/gg/22222'), 'src': WindowsPath('gg/22222')},
      {'dst': WindowsPath('C:/yourpath/master'), 'src': WindowsPath('master')},
      {'dst': WindowsPath('C:/yourpath/nofastmerge'),
      'src': WindowsPath('nofastmerge')}]
    

Caution

The output path(-o) needs an absolute path and should be wrapped by quotes when on windows.

cpdiff's People

Contributors

tkhuang avatar

Watchers

 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.