GCD - A different cd
Primary used for quickly navigating between git projects.
Supports
- git projects, the GCD database is populated using the gcd-init/gcd-update commands.
- non project folders, these can be added to the GCD database with gcd-add command.
- aliases for git project and non git project folders can be set using the gcd-alias command.
Note: A git project folders is a folder that has a '.git' sub folder, no other checks are done.
Installation
Currently you need to build the binaries your self.
prerequisites
A working Rust build system https://www.rust-lang.org/tools/install.
the code
Get the code from.
Build and install it.
Once the console dependency is updated this will change in a normal cargo install
Installation
binaries
Install the binaries as described above.
script (unix)
Either copy the gcd script from the scripts folder into your ${HOME}/bin folder. (or equivalent, like ${HOME}/.cargo/bin)
Or create a gcd script as follows
#!/bin/bash
SCRIPT_FILE=" /.gcd/gcd-cd.sh"
if ; then
fi
bash alias
And lastly, make an entry into your .bash_aliases file like:
alias gcd='source /home/ordina/bin/gcd'
Note: sourcing the shell script is needed else the internal 'cd' command will not work as expected.
script (windows)
Either copy the gcd.bat script from the scripts folder into your path folder. like ${APPDATA}/.cargo/bin
Or create a gcd script as follows
@echo off
call -select
if exist %APPDATA%\.gcd\gcd-cd.bat
first time use
after installation call the gcd init to initialize the database and perform the initial search for projects_dir
Basic use
gcd is made up out of a number of different applications. Gcd-select is the main one, it is however not called directly but via a shell script.
- gcd-select, called from the gcd script and is used to select a project.
- gcd-init, initializes the database. it will overwrite the complete database. loosing all usage data, and aliases.
- gcd-alias, set an alias for the current folder, if the current folder is not a known project. nothing will happen.
- gcd-add, adds the current folder to the database.
- gcd-purge, purges aka removes all project from the database that are no longer available.
- gcd-delete, removes the current folder from the database.
- gcd-update, updates the database, as opposed to the gcd-init, this will only add projects that are not yet in the database