Skip to main content

A wrapper for "git clone" that keeps git repo directories organized

Project description

Refclone

refclone is a wrapper for git clone command that keeps cloned git repositories organized.

Installation

pip3 install --user git+https://alcm-b@bitbucket.org/alcm-b/refclone.git

Usage

refclone.py https://gitserver.example.com/user/project

The above will clone the repository into a default location, ~/ref and create subdirectories, so the full path will be ~/ref/gitserver.example.com/user/project

refclone.py --repohome=/home/username/ref https://gitserver.example.com/user/project

You may use other default directory by supplying --repohome argument. To keep the same repohome directory for all git projects you clone, set this pair of aliases in ~/.bashrc:

alias refclone='refclone --repohome=/home/username/projects'
alias cdref='cd /home/username/projects'

After that, you can start using refclone like this:

refclone https://gitserver.example.com/user/project
cdref
cd gitserver.example.com/user/project
# start exploring the code

Description

refclone ensures that all git repositories I clone are located in the same place, nicely organized by server url, user and project name. It also shaves off a couple of commands I have to run each time I want to take a look at the source code of one more open source project.

Effectively, this utility is a shortcut for these two UNIX shell commands:

mkdir -p "/<repohome>/<server-url>/<username>/<project-name>/"
git clone <git-url> /<repohome>/<server-url/<username>/<project-name>/

, where <repohome> is provided in command line option --repohome.

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

refclone-0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refclone-0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file refclone-0.3.tar.gz.

File metadata

  • Download URL: refclone-0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for refclone-0.3.tar.gz
Algorithm Hash digest
SHA256 539e8b6651ff0369fbbb3cc3eb665946ffdd863c9b90e79a984d496696f6bfd1
MD5 2f14124ace17e06ff4e8c1ffd89930ed
BLAKE2b-256 5bef4ac3edcae79653b1dfabbf3c2bc1f6e490ca74b440fe8ecdf18800831b30

See more details on using hashes here.

File details

Details for the file refclone-0.3-py3-none-any.whl.

File metadata

  • Download URL: refclone-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for refclone-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3dc9a9cf77b5f5b229084fa7797206c8fc775463b02c89916a5a87c7691fd7d5
MD5 dbdcf7c97a64f37ad91fed41c69198d5
BLAKE2b-256 fa55ede3fadf0bf0cb6aeb47ddbf38d752fe7a0fc6ed122d9d02316034b82516

See more details on using hashes here.

Supported by

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