Skip to main content

Goals

To provide a simple tool for quickly creating private git repos ‘in the cloud’ wherever that may be.

Installation

Requires python 3.

pip3 install gt should do the trick, or else python setup.py install from source.

Usage

Create ~/.gtrc and populate it with sections of the following form

[<source name>]
type=<git source>
<param1>=<val1>
<param2>=<val2>

where <git source> indicates the source type.

Supported sources at the time of writing include: - gitlab (the service) - ssh (An ssh-able Unix box containing a directory full of repos)

Examples

~/.gtrc

[ s1 ]
type=ssh
host=dionysus
user=rvaiya
project_dir=/storage/projects

[ gl ]
type=gitlab
api_token=a734d981ddda8

CLI Usage

# gt -l

s1/project1
s1/project2
gl/projecta
gl/projectb

# gt -c s1/project3

Successfully created s1/project3
git remote add origin ssh://rvaiya@dionysus:/storage/projects/project3

# gt -d gl/projecta

Successfully deleted gl/projecta

# gt --clone gl/projecta

Cloning into 'projecta'...
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 20 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (20/20), 22.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (2/2), done.
Checking connectivity... done.

Bugs/Limitations

The tool is designed to handle as many git sources as possible and so only supports primitive operations (i.e add/remove/delete). Since it is primarily intended for personal use it does not support sophisticated project or permission management features which are commonly found on proprietary collaboration platforms like github.

There will be bugs.

Extensibility

Adding a source should be as simple as creating a python file in gt/sources and defining a class with the following methods:

  • list()

  • delete(name)

  • create(name)

The class name serves as the source type and its constructor’s parameter names are drawn from the relevant section of the config file when instantiating the object.

It is worth noting that the project began life as a bash script and was partly rewritten as an exercise in python by the author. As such things may not be optimally ‘pythonic’ :). If you bother to read the code and invariably feel the need to abuse the person who wrote it, know that such sentiments will be happily received at r.vaiya@gmail.com.

Metadata

Release files for gt 0.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gt 0.2.9
File Size Uploaded
gt-0.2.9.tar.gz 5.5 kB Details

Release files / gt-0.2.9.tar.gz

Download URL gt-0.2.9.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3d34a24641a7d3c186a8db87a744364f1c563de78093eefc3a019c8e51fabbc6
BLAKE2b-256 checksum
How to use checksums
cac5f507e08587b8c8f29745caf22e13678b2e8be42b7f6c018688d38d7da9b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.3.15

1 release file

0.3.14

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.09

1 release file

0.3.08

1 release file

0.3.07

1 release file

0.3.06

1 release file

0.3.05

1 release file

0.3.04

1 release file

0.3.03

1 release file

0.3.02

1 release file

0.3.01

1 release file

0.3.00

1 release file

0.2.11

1 release file

0.2.10

1 release file

This release

0.2.9 This release

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page