Skip to content

Latest commit

 

History

History
93 lines (62 loc) · 2.54 KB

README.md

File metadata and controls

93 lines (62 loc) · 2.54 KB

GitHelper

A golang cli tool for automating GIT work in multiple repositories

Are you tired of typing the same git commands on multiple repositories of your project? Are you tired of opening and updating Pull Requests for each repository?

This cli may be your solution to help you save time.

Installation

Change the version for the version you want (withouth initial v)

Linux amd64

export GITHELPER_VERSION=0.3.0
curl -L "https://github.com/felipem1210/git-helper/releases/download/v${GITHELPER_VERSION}/git-helper_${GITHELPER_VERSION}_linux_amd64.tar.gz" |tar xzv -C /tmp
sudo mv /tmp/git-helper /usr/local/bin/git-helper
chmod +x /usr/local/bin/git-helper

MacOS amd64

export GITHELPER_VERSION=0.3.0
curl -L "https://github.com/felipem1210/git-helper/releases/download/v${GITHELPER_VERSION}/git-helper_${GITHELPER_VERSION}_darwin_amd64.tar.gz" |tar xzv -C /tmp
sudo mv /tmp/git-helper /usr/local/bin/git-helper
chmod +x /usr/local/bin/git-helper

Envars needed

  • Define the envar WORKING_DIR. This must be the folder where you have all the repositories you want to manage.
export WORKING_DIR=$(pwd)
  • Define GIT_ACCESS_USER and GIT_ACCESS_TOKEN with your Github Username and Token

Git integration

You can run local git commands alongside multiple repositories that are inside the $WORKING_DIR:

  • clone (Repos grouped in a Github Org).
  • checkout
  • add all new content
  • create new branch locally
  • pull
  • commit
  • reset to HEAD
  • rebase
  • push
  • fetch
  • status

Github integration

You can run following actions in github:

  • Create repositories.

You need to provide a json file with info of the repos you want to create. Check this json file with the example of the file. Place the file in your $WORKING_DIR

cp examples/json-files/new_repos.json $WORKING_DIR

After creating the repositories a file repos_info.json will be created. don't erase it

  • Create/update/merge pull requests

You need to provide a json file with info of the PRs you want to create. Check this json file with the example of the file. Place the file in your $WORKING_DIR

cp examples/json-files/new_prs.json $WORKING_DIR

After creating the repositories a file pr_info.json will be created. don't erase it

If you want to update you can only update these fields: title, body, state, base, maintainer_can_modify.

Gitlab integration

COMING SOON

Usage

Use the --help

git-helper --help