GithubHelp home page GithubHelp logo

sparlix / commit_manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xypnox/commit_manager

1.0 0.0 0.0 2.86 MB

Setup-and-forget automated commit and push for git with linear daily commit history.

License: MIT License

Shell 100.00%

commit_manager's Introduction

Banner

Setup-and-forget automated commit and push for git with linear daily commit history.

For mac see the commit_manager_mac.sh script.

Auto commit script

  • Should Commit every 10 minutes to daily branch
  • Should Squash Merge Daily branch to main once every day
  • Should push daily branch to github
  • Should push main branch to github
  • Should keep pruning the daily branches from both github and local git
  • Should auto switch daily branches when next day

Setup

It is preferred that you use ssh to clone and setup git repo you want to track, this makes committing and pushing available for cronjobs without any setup for auth.

Although the script can work on it's own, it is better to setup a cronjob such that it runs automatically.

  • Copy the script to the root of the repo you want to track.
  • Update the config:
    # Config
    directory="/home/xypnox/notes/"
  • Setup a cronjob to run it every 10 minutes. */10 * * * * bash /Users/apple/notes/commit_manager_mac.sh
  • Additionally if you want to setup a log file to see if the git commands errored and when, extend the cronjob as: */10 * * * * bash /Users/apple/notes/commit_manager_mac.sh >> /Users/apple/notes/commit_manager_log.txt 2>&1

TODO

  • Handle skipped days.
  • Add buffer before deleting day branches.
  • Figure out a way to push stuff.
  • Add squash commit.
  • Add loop every 10 minutes

Notes

Logic

For every 10 minutes do:

  • Check if the previous day's branch is merged
    • If not commit and merge it
    • After merge, push main and delete yesterday's branch
      • Remote and local
  • Check if the main after prev merge is pushed
    • If not do so
  • Create today's branch if it doesn't exist
  • If there are any changes
    • Commit and push changes on today's branch

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.