An open API service indexing awesome lists of open source software.

https://github.com/tremainebuchanan/github-remote-cli-helper


https://github.com/tremainebuchanan/github-remote-cli-helper

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

# Github Remote Helper (grh)

## Project Description

**Github Remote Helper (grh for short)** is a command line interface (cli) tool allowing users to generate the required `git remote add origin` string for a project in the scenario where users like myself maintain multiple github accounts on one workstation.

## Problem

As a developer, I work with a number of organizations at any given time. As such, I'm working on multiple code bases through different github accounts.
After doing some research, [I found this FreeCodeCamp article](https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/) which assisted me in setting up the various accounts on my mac.
However, the `remote origin`
details generated by [Github](github.com) whenever a repository is created is not compatible with this particular setup as per the [article](https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/) .
The setup requires the `remote origin` to be in the format `git@github-organisation-name:github-username/repository-name.git`. Therefore, `grh` was developed to automate
the creation of the required `remote origin` string.

## Languages

The project was written in [Go](https://go.dev/) as I wanted `grh` to be as cross platform as possible and limit the need for a user to install third party dependencies or libraries. The repository contains a build file `grh` for the macOs.

## Installation

To use `grh` straight away, copy the `grh` binary from the repository to your `/usr/local/bin` folder.

Once copied:

1. Open the terminal
2. Type `grh -o organisation-name -u username -r repo-name` replacing `organisation-name` with the organisation which you configured in your
`.ssh/config` file ([as per article](https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/)), `username` with the specific username tied to organisation and finally the `repo-name` provided by github upon repository creation.

## Roadmap

1. Build tool for Linux and Windows
2. Add tests
3. Add the generated text to the clipboard of the operating system
4. Indicate to the user that they should change the `user.email` in `git global` before committing and pushing changes.
## License

[MIT](LICENSE.md)