Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gt-0.2.9.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file gt-0.2.9.tar.gz.

File metadata

  • Download URL: gt-0.2.9.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gt-0.2.9.tar.gz
Algorithm Hash digest
SHA256 3d34a24641a7d3c186a8db87a744364f1c563de78093eefc3a019c8e51fabbc6
MD5 178ee32132096639e59214fd4b9a65b5
BLAKE2b-256 cac5f507e08587b8c8f29745caf22e13678b2e8be42b7f6c018688d38d7da9b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page