Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/franko/bash-git-prompt
A fast git prompt that show the branch filename without calling any external command
https://github.com/franko/bash-git-prompt
Last synced: about 6 hours ago
JSON representation
A fast git prompt that show the branch filename without calling any external command
- Host: GitHub
- URL: https://github.com/franko/bash-git-prompt
- Owner: franko
- Created: 2021-05-07T07:59:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T20:27:23.000Z (11 months ago)
- Last Synced: 2024-05-01T20:27:01.332Z (7 months ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bash-git-prompt
A fast git prompt that show the branch filename without calling any external command.
## What it does
It prints a nice prompt to show the git branch you are actually in if you are inside a git working directory.
## Why
It is very useful to have immediately the information about the branch you are currently in.
It is the same principle of showing the current working directory in the prompt.To be really tolerable it has to be **fast** because the code it is called every time the prompt is shown.
If it is slow it can be quickly very annoying and this limit its usefulness.
in addition, on Windows, spawning a process is very slow and the delay quickly becomes intolerable.In order to be fase the script does not call any external command, including git.
It only use bash constructs and internal commands.
The information about the git branch is found simply reading the file .git/HEAD.## Limitations
It does not display other information except the branch you are in and it doesn't call "git fetch" for you.
We consider that git fetch is a command that should be given explicitly.## How to use
Copy the bash code into your ".bashrc" file in your HOME directory.