A tool to monitor git repositories and automatically pull & push changes

git-o-matic

A tool to monitor git repositories and automatically pull & push changes

Installation

Packages & Binaries

From Source

Make sure you have a working Go environment (Go 1.11 or higher is required). See the install instructions.

Compiling gitomatic is easy, simply run:

git clone https://github.com/muesli/gitomatic.git
cd gitomatic
go build

Usage

Monitor a repository for changes and automatically pull & push changes:

gitomatic <path>

2019/08/03 00:16:48 Checking repository: /tmp/gitomatic-test/
2019/08/03 00:16:48 Pulling changes...
2019/08/03 00:16:49 New file detected: hello_world.txt
2019/08/03 00:16:49 Adding file to work-tree: hello_world.txt
2019/08/03 00:16:49 Creating commit: Add hello_world.txt.
2019/08/03 00:16:49 Pushing changes...
2019/08/03 00:16:53 Sleeping until next check in 10s...
2019/08/03 00:17:03 Checking repository: /tmp/gitomatic-test/
2019/08/03 00:17:03 Pulling changes...
2019/08/03 00:17:07 Deleted file detected: hello_world.txt
2019/08/03 00:17:07 Removing file from work-tree: hello_world.txt
2019/08/03 00:17:07 Creating commit: Remove hello_world.txt.
2019/08/03 00:17:07 Pushing changes...

Auth methods:

gitomatic -privkey ~/.ssh/id_rsa <path>
gitomatic -username "someone" -password "mypass" <path>

If you want to pull new changes but don't create commits (or vice versa):

gitomatic -pull=true -push=false <path>

You can control how often gitomatic checks for changes:

gitomatic -interval 30m <path>

Change the commit author's name and email:

gitomatic -author "John Doe" -email "[email protected]" <path>
Owner
Christian Muehlhaeuser
Geek, Gopher, Software Developer, Maker, Opensource Advocate, Tech Enthusiast, Photographer, Board and Card Gamer
Christian Muehlhaeuser
Comments
  • Setting email / author fails.

    Setting email / author fails.

  • Key Types are Unrecognized

    Key Types are Unrecognized

    Hey, I've tried for about an hour but I can't get any combination of keys/settings working. Can anyone provide an example of a working configuration?

    Here's one I tried that does not work, for instance:

    ssh-keygen -t ecdsa -b 521 -C "[email protected]"
    # Add key to GitHub
    gitomatic -privkey ~/.ssh/id_ecdsa_gitomatic ./
    

    Shows this error:

    git-o-matic
    cannot parse key: ssh: unhandled key type
    

    This project is pretty cool but is not working ATM.

  • Cant run without privkey existing and not working for public github repos

    Cant run without privkey existing and not working for public github repos

    So I have two issues, firstly on a brand new ubuntu box with a user who has no key running the tool gives me the error:

    cannot parse key: open /root/.ssh/id_rsa: no such file or directory
    

    I tried passing in garbage but it says that its not a valid pem.

    After generating a key at the expected location and trying to use this on a public git repo it won't work. I tried adding a fake username and password but it just says:

    cannot pull from repository: authentication required
    

    Is it possible to allow a no-auth option and just let git try seeing as its already setup to be able to pull public https repos?

  • Error cannot pull from repository

    Error cannot pull from repository

    So, I have been interested to use git-o-matic to deploy some internal network containers using git-hooks automatically.

    The way I have in mind is using git-o-matic to automatically pull changes in my develop branch and use my post-merge hooks (Already working) to restart the container with said new code.

    My problem is I keep getting the following message:

    2020/02/17 15:04:57 Checking repository: .
    2020/02/17 15:04:57 Pulling changes...
    cannot pull from repository: non-fast-forward update
    

    The way I am launching it in my server is:

    gitomatic -privkey <path-to-my-deploy-key> -pull=true -push=false <path-to-my-local-repo> 
    

    Any help regarding getting this to work would be appreciated.

  • Check before exit when an interrupt is received

    Check before exit when an interrupt is received

    This PR changes the program to do one final pull and push before exiting the process when an interrupt is received.

    The use case I have is as follows: I have a simple script which opens a texteditor to edit notes and uses a forked gitomatic to push any changes. When the editor closes, I terminate gitomatic, however that means changes won't be pushed by gitomatic until the next run.

  • Add ability to not commit when on certain branches

    Add ability to not commit when on certain branches

    It would be nice to have a few protected branches passable as command line options. Something so that I can just leave this running and don't commit to a release branch a bunch accidentally.

Related tags
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI

A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. Abstract Trivy (tri pronounced like trigger, vy

Jan 9, 2023
SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase

gitbase gitbase, is a SQL database interface to Git repositories. This project is now part of source{d} Community Edition, which provides the simplest

Dec 25, 2022
Quickly clone git repositories into a nested folders like GOPATH.

cl cl clones git repositories into nested folders like GOPATH and outputs the path of the cloned directory. Example: cl https://github.com/foo/bar Is

Nov 30, 2022
A simple cli tool for switching git user easily inspired by Git-User-Switch
A simple cli tool for switching git user easily inspired by Git-User-Switch

gitsu A simple cli tool for switching git user easily inspired by Git-User-Switch Installation Binary releases are here. Homebrew brew install matsuyo

Dec 31, 2022
Git with a cup of tea, painless self-hosted git service
Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Jan 2, 2023
ReGit: A Tiny Git-Compatible Git Implementation written in Golang

ReGit is a tiny Git implementation written in Golang. It uses the same underlying file formats as Git. Therefore, all the changes made by ReGit can be checked by Git.

Oct 31, 2022
A Git RPC service for handling all the git calls made by GitLab
A Git RPC service for handling all the git calls made by GitLab

Quick Links: Roadmap | Want to Contribute? | GitLab Gitaly Issues | GitLab Gitaly Merge Requests | Gitaly is a Git RPC service for handling all the gi

Nov 13, 2021
Removes unnecessarily saved git objects to optimize the size of the .git directory.

Git Repo Cleaner Optimizes the size of the .git directory by removing all of the files that are unnecessarily-still-saved as part of the git history.

Mar 24, 2022
Gum - Git User Manager (GUM) - Switch between git user profiles
Gum - Git User Manager (GUM) - Switch between git user profiles

Git User Manager (GUM) Add your profile info to config.yaml Build project: go bu

Feb 14, 2022
Git-now-playing - Git commits are the new AIM status messages

git-now-playing git-now-playing is an attempt to bring some of the panache of th

Apr 4, 2022
This github action find the Issues linked in a Pull Request.

Linked Issue (Github Action) This action find the Issues linked in a Pull Request. It parses the HTML of the PR page to find the linked issues. Inputs

Jun 30, 2022
Find trending repositories on GitHub
Find trending repositories on GitHub

octotrends.com A niftly little tool I wrote to try and find repos and languages that are rapidly growing on GitHub. Growth rates are based on % growth

Jun 14, 2022
A command-line tool that makes git easier to use with GitHub.

hub is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier. For an official

Jan 1, 2023
Fast and powerful Git hooks manager for any type of projects.
Fast and powerful Git hooks manager for any type of projects.

Lefthook The fastest polyglot Git hooks manager out there Fast and powerful Git hooks manager for Node.js, Ruby or any other type of projects. Fast. I

Jan 4, 2023
go mod vendor lets you check in your dependencies to git, but that's both bloaty (for developers) and tedious (remembering to update it).

go-mod-archiver Afraid of being unable to build historical versions of your Go program? go mod vendor lets you check in your dependencies to git, but

Dec 1, 2022
A single Git repository that holds two microservices (Python and GO)

A single Git repository that holds two microservices (Python and GO)

Nov 19, 2021
Installs git repos onto your system and keeps them up-to-date

Gitfile Installs git repos onto your system and keeps them up-to-date. It's a lightweight package manager for things that haven't been published to a

Jan 16, 2021
Sync tags in your git repository and a changelog in Keep a Changelog format with releases of your GitLab project.

Automatic GitLab releases Sync tags in your git repository and a changelog in Keep a Changelog format with releases of your GitLab project. Features:

Nov 12, 2022
Gogs is a painless self-hosted Git service
Gogs is a painless self-hosted Git service

Gogs - A painless self-hosted Git service 简体中文 ?? Vision The Gogs (/gɑgz/) project aims to build a simple, stable and extensible self-hosted Git servi

Jan 9, 2023