https://github.com/kabeep/git-short-dir-prompt
Focus on the development of the current repository by using a concise repository path in the command line prompt.
https://github.com/kabeep/git-short-dir-prompt
Last synced: 6 months ago
JSON representation
Focus on the development of the current repository by using a concise repository path in the command line prompt.
- Host: GitHub
- URL: https://github.com/kabeep/git-short-dir-prompt
- Owner: kabeep
- License: mit
- Created: 2024-01-09T09:45:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T03:22:52.000Z (almost 2 years ago)
- Last Synced: 2024-10-21T06:29:59.338Z (almost 2 years ago)
- Language: Shell
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
git-short-dir-prompt
A Bash script to simplify Git working directory paths for enhanced efficiency and focus in the command line
---



[](CHANGELOG.md)
[](LICENSE)
English | [įŽäŊ䏿](README.zh-CN.md)
## đ Features
`git-short-dir-prompt` is a script designed for the Bash shell environment, based on the concept of [git-prompt.sh](https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh). It displays a concise directory path within Git repositories.
It aims to enhance work efficiency and focus in the command line, especially suitable for developers who need to navigate quickly through complex directory structures.
> It helps you:
>
> - Automatically detect if the current directory is a Git repository, not just initialized
>
> - Hide lengthy working directory paths in Git directories
>
> - Simplify paths to clearly point to the user and GitHub repository address
>
> - Resolved the issue of case insensitivity on Windows
#### Default Command Line Prompt

#### Simplified Command Line Prompt

## âī¸ Installation
1. Clone the repository
```shell
git clone https://github.com/kabeep/git-short-dir-prompt.git
```
2. Enter the project directory
```shell
cd git-short-dir-prompt
```
3. Execute the installer
```shell
./install.sh
```
4. Edit `.bash_profile` to call during initialization
```shell
vim ~/.bash_profile
### .bash_profile
# change your username
PS1="$PS1"'username' # username
# change your hostname
PS1="$PS1"'@hostname ' # hostname
```
5. Load `.bash_profile` or Restart Terminal
```shell
source ~/.bash_profile
```
## đ Usage
Once installed and configured, when you enter a Git repository directory, the command line prompt will automatically update to display a simplified directory path.
## đ¤ Contribution
Contributions via Pull Requests or [Issues](https://github.com/kabeep/git-short-dir-prompt/issues) are welcome.
## đ License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.