GithubHelp home page GithubHelp logo

git-commit-via-date-range's Introduction

git-commit-via-date-range

Add files to a Git repository based on specified date ranges. Tested on Linux.

This program honors all normal Git configurations, like .gitignore files and such.

Dependencies / Requirements

pip install GitPython pytz

Create a local python environment

If the dependency GitPython and pytz are not available on the system, you can install them locally to an isolated Python environment.

python3 -m venv '.venv'
source .venv/bin/activate
pip install GitPython pytz

Assumptions

The input path argument (base folder) contains the Git repository you want to commit to.

Usage

General form (when Git has prior commits to compare against):

python git-commit-via-date-range.py /path/to/folder/with/git/repository YYYY-MM-DD <timezone>

Starting form (when the local Git repository has no prior commits):

python git-commit-via-date-range.py /path/to/folder/with/git/repository YYYY-MM-DD <timezone> YYYY-MM-DD <timezone>

Case 1: No starting date

Used when the Git repository has prior commits to compare against.

python git-commit-via-date-range.py /path/to/your/git/repository 2024-01-25 America/Los_Angeles

Case 2: With starting date

Used when the local Git repository has no prior commits.

python git-commit-via-date-range.py /path/to/your/git/repository 2024-01-25 America/Los_Angeles 2024-02-01 America/New_York

Usage with local Python Environment

source /home/username/code/python/git-commit-via-date-range/.venv/bin/activate
python /home/username/code/python/git-commit-via-date-range/git-commit-via-date-range.py

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.