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.6.tar.gz (6.2 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.6-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for refclone-0.6.tar.gz
Algorithm Hash digest
SHA256 f618e6fc3b7aa7a1062094854b095b05c999c0de846a74218f6b802717dc47fa
MD5 7508b5429489156e1886dc9a87e47202
BLAKE2b-256 be84fa117352056ed831ab0df8725aa438df1396469e53f09d4ef25588e69e13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refclone-0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 237290ceac48bc7688b1634873c3f3bfc31a31d9746c6af84d5611f454c17d42
MD5 e8e339495b413c134d31d902640431d7
BLAKE2b-256 fe0256846319dc4f302be82b2e838fb2bbd50628009ed37a173fef21649a2452

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