Skip to main content

A terminal tool for easy navigation to local git repository

Project description

git-cd

GitHub Workflow Status GitHub release PyPI PyPI - Downloads PyPI - Python Version Licence

A terminal tool for easy navigation to local git repository. It let you change to a repository directory easily.

Table of content

Installation

Install with pip

$ pip3 install git-cd

Usage

Type gitcd or gitcd -h will show you the command help page

$ gitcd
Usage: gitcd [OPTIONS] [REPO]

  gitcd [your-repo-name]

  Terminal tool for easy navigation to local git repository

  For more detail: please visit https://github.com/Doma1204/gitcd

Options:
  -i, --index             index all the local repo
  -u, --update            update the local repo index
  -p, --path PATH         only find local repo under this path
  -a, --autocomplete      activate shell autocompletion
  -s, --shell [bash|zsh]  specify the shell
  -h, --help              Show this message and exit.

Change Directory

$ gitcd [repo-name]

It changes the current directory to the corresponding local repository. Press Tab to autocomplete the repository name if needed(activate autocompletion is required)

Indexing Local Repositories

Before using gitcd to change directory, you needs to first index you local repositories. Use the commmand below to start indexing.

$ gitcd -i

The default root directory is home directory(~/). It starts finding local repositories recursively from the root directory. You can change the root directory by using -p.

$ gitcd -i -p [root-path]

Update Local Repository Index

If some of the repositories have been deleted, the old index will still contain those invalid repositories directory, and errors occur when you attemps to cd into deleted repositories. Thus, you needs to update the local repository index by the following command. It deletes all invalid repositories.

$ gitcd -u

Autocompletion

Limited by Click, autocompletion only support bash and zsh shell. To activate autocompletion, use the command below:

$ gitcd -a

In normal cases, it detects the current shell and activate the autocompletion of that shell, but you can specify the shell that you wants to activate by using -s.

$ gitcd -a -s [bash or zsh]

To actiavte autocompletion manually, you needs to add the following line to you .bashrc(bash) or .zshrc(zsh).

For bash: eval "$(_GITCD_COMPLETE=source gitcd)"

For zsh: eval "$(_GITCD_COMPLETE=source_zsh gitcd)"

Dependencies

The tool is built on top of Click.

Licence

MIT Licence

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

git-cd-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

git_cd-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file git-cd-0.0.1.tar.gz.

File metadata

  • Download URL: git-cd-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.6

File hashes

Hashes for git-cd-0.0.1.tar.gz
Algorithm Hash digest
SHA256 30f8179fe220f39e989df02b7a6bf8d01908cb2d3f3be8b3a8b566e8c06509d6
MD5 7d5871bcce78c414526004501dbd810d
BLAKE2b-256 e412887bcdf87a326a91f109874a0c66c29b3940b3336dcbfa0bc1a64ac48a04

See more details on using hashes here.

File details

Details for the file git_cd-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: git_cd-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.6

File hashes

Hashes for git_cd-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e27711640d171a1085377c7b8da04e3b7ea707f9c643cb423028692475d67600
MD5 0ba3b0e235af35f6fbffe670e5c0760d
BLAKE2b-256 42c4e6cfd1066e7777069b6397eb135d116ef967235292ba5db33ddb503c84a4

See more details on using hashes here.

Supported by

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