Skip to content

Focus on the development of the current repository by using a concise repository path in the command line prompt.

License

Notifications You must be signed in to change notification settings

kabeep/git-short-dir-prompt

Repository files navigation

git-short-dir-prompt

A Bash script to simplify Git working directory paths for enhanced efficiency and focus in the command line


Linux Windows MacOS Version License

English | 简体中文

📖 Features

git-short-dir-prompt is a script designed for the Bash shell environment, based on the concept of 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

default_prompt

Simplified Command Line Prompt

simplified_prompt

⚙️ Installation

  1. Clone the repository
git clone https://github.com/kabeep/git-short-dir-prompt.git
  1. Enter the project directory
cd git-short-dir-prompt
  1. Execute the installer
./install.sh
  1. Edit .bash_profile to call during initialization
vim ~/.bash_profile

### .bash_profile
# change your username
PS1="$PS1"'username'                    # username
# change your hostname
PS1="$PS1"'@hostname '                  # hostname
  1. Load .bash_profile or Restart Terminal
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 are welcome.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Focus on the development of the current repository by using a concise repository path in the command line prompt.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages