FancyGit is a tool which works for Linux and MAC OS, that changes the terminal prompt in order to show you a few cool git informations when you're working on a git repo. It'll always keep you informed about the current branch status.
π Contributing | π§ Changelog | π¨ Troubleshooting
curl -sS https://raw.githubusercontent.com/diogocavilha/fancy-git/master/install.sh | sh
curl -sS https://raw.githubusercontent.com/diogocavilha/fancy-git/master/uninstall.sh | sh
- Change the font in your terminal application to one of these fonts:
- Sauce-Code-Pro-Nerd-Font-Complete-Windows-Compatible.ttf.
- DejaVu-Sans-Mono-Nerd-Font-Complete.ttf.
- DejaVu-Sans-Mono-Nerd-Font-Complete-Mono.ttf.
- JetBrains-Mono-Regular-Nerd-Font-Complete-Mono.ttf.
- JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf.
It's necessary for rendering icons/symbols properly.
If you can't find the font, it's still possible to install it manually by runningfancygit --fonts-install
or even installing the ttf file which is placed at~/.fancy-git/fonts/
. NB for Windows Terminal only the Sauce Code option above will display git icons correctly.
- Restart your terminal.
Run fancygit -h
to check FancyGit help.
git config --global color.ui true
git config --global color.diff.meta "yellow bold"
git config --global color.diff.old "red bold"
git config --global color.diff.new "green bold"
git config --global color.status.added "green bold"
git config --global color.status.changed "yellow"
git config --global color.status.untracked "cyan"
Run fancygit --suggested-global-git-config
to see that suggested config.
Run fancygit --suggested-global-git-config-apply
to apply it.
I suggest you to use this config because FancyGit will paint the background branch, most of the time, according to the current repo status, since you're using some theme which allows that.
Type fancygit -h
for more information.
As a picture is worth a thousand words...
Working on a Python virtual environment?
If you don't want to be too "fancy", you can choose using the simple theme by running fancygit --theme-simple
.
If you want to return to the default theme, just type fancygit --theme-default
.
There are a few more themes and color schemes you can choose from.
Type fancygit -h
to see all available themes and color schemes on "THEME COMMANDS" and "COLOR SCHEME COMMANDS" sections.
Here you have a list of available themes and their corresponding color schemes.
Screenshot font: JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf
fancygit --theme-default (default color scheme: --color-scheme-default)
fancygit --color-scheme-dracula
fancygit --color-scheme-batman
fancygit --color-scheme-superman
fancygit --theme-human (default color scheme: --color-scheme-human)
fancygit --theme-simple (default color scheme: --color-scheme-simple)
You can type fancygit --separator<TAB>
so you can see all the available separator styles for you to use.
It's highly recommended to set up the terminal font to one of:
- Sauce-Code-Pro-Nerd-Font-Complete-Windows-Compatible.ttf.
- DejaVu-Sans-Mono-Nerd-Font-Complete.ttf.
- DejaVu-Sans-Mono-Nerd-Font-Complete-Mono.ttf.
- JetBrains-Mono-Regular-Nerd-Font-Complete-Mono.ttf.
- JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf.
This way, symbols will be rendered correctly and new FancyGit releases must work as expected.
In order to install the fonts you can run fancygit --fonts-install
.
Screenshot font: Sauce-Code-Pro-Nerd-Font-Complete-Windows-Compatible.ttf
fancygit --separator-blocks-tiny
Feature switchers are special commands to enable/disable features and they work on every theme.
You can enable or disable them by typing fancygit --enable-<feature-name>
or fancygit --disable-<feature-name>
.
Type fancygit -h
to see all available feature switchers on "FEATURE SWITCHER COMMANDS" section.
Command | Description |
---|---|
fancygit -h, --help | Show this help. |
fancygit -v, --version | Show the FancyGit version. |
fancygit --update | Update FancyGit code with the latest release from GitHub. |
fancygit --fonts-install | Install font in order to render icons properly. |
fancygit --suggested-global-git-config | Show suggested global git config. |
fancygit --suggested-global-git-config-apply | Apply the suggested global git config. |
fancygit --config-list | Show FancyGit config. |
fancygit --reset | Reset the configuration as if you have just installed FancyGit. |
fancygit --changelog-show | Show changelog for the last version. |
fancygit --show-themes | Show all available themes. |
fancygit --show-color-schemes | Show available color schemes for current theme. |
fancygit --show-color-schemes-all | Show all available color schemes. |
fancygit --enable-full-path | Show the entire path. |
fancygit --disable-full-path | Show only the the working directory name. |
fancygit --enable-show-user-at-machine | Show (user@machine) info, as usual. |
fancygit --disable-show-user-at-machine | Hide (user@machine) info. |
fancygit --enable-time | Show current time. |
fancygit --disable-time | Hide current time. |
fancygit --enable-double-line | Show a double line prompt. |
fancygit --disable-double-line | Show a single line prompt. |
fancygit --enable-rich-notification | Show notification area with icons. |
fancygit --disable-rich-notification | Show notification area with simple symbols. |
fancygit --enable-bold-prompt | Show bold prompt font. |
fancygit --disable-bold-prompt | Show regular prompt font. |
fancygit --enable-host-name | Show host name. |
fancygit --disable-host-name | Hide host name. |
fancygit --enable-user-symbol | Show user symbol. |
fancygit --disable-user-symbol | Hide user symbol. |
fancygit --set-user-name {name} | Set the user name. |
fancygit --unset-user-name | Restore the user name to default. |
fancygit --set-host-name {name} | Set the host name. |
fancygit --unset-host-name | Restore the host name to default. |
fancygit --enable-git-clear | Clear the terminal as part of some git aliases |
fancygit --disable-git-clear | Do not clear the terminal with any git aliases |
fancygit --separator-default | Change the separator to default style. |
fancygit --separator-blocks | Change the separator to blocks style. |
fancygit --separator-blocks-tiny | Change the separator to blocks-tiny style. |
fancygit --separator-fire | Change the separator to fire style. |
fancygit --separator-lego | Change the separator to lego style. |
fancygit --separator-curve | Change the separator to curve style. |
fancygit --separator-paint | Change the separator to paint style. |
fancygit --theme-<name> | Change prompt to the selected theme. |
fancygit --color-scheme-<name> | Change to the selected color scheme. |
Alias | Description |
---|---|
gs | Show git status. (git status ) |
ga <file> ... | Add a file in order to commit. (file) |
gap <file> | Add a file in order to commit. (git add -p <file> ) |
gaa | Add all files in order to commit. (file) |
gd | Show changes of a file and suggests to add it. (git diff ) (file) |
gcm | Start committing. (git commit) |
gcmm "<message>" | Start committing with a message. (git commit -m "<message>" ) |
gpl | Git pull. (git pull ) (file) |
gps | Git push. (git push ) |
gplo <branch-name> | Git pull from <branch-name> to current local branch. (git pull origin <branch-name> ) (file) |
gpso <branch-name> | Git push from current local branch to <branch-name>. (git push origin <branch-name> ) |
gplob | Git pull from remote current branch to local current branch. (file) |
gpsob | Git push from local current branch to remote current branch. (file) |
gck <file> ... | Rollback file changes. (git checkout -- <file> ) (file) |
gckb <branch-name> | Switch to a branch. (git checkout <branch-name> ). |
gckbt <branch-name> | Switch to a branch with --track option. (file) |
gcb <branch-name> | Create and switch to the new branch. (git checkout -b <branch-name> ) |
ggdb <branch-name> | Delete a local branch. (git branch -D <branch-name> ) |
gdbr <branch-name> | Delete a remote branch. (git push origin --delete <branch-name> ) |
grb <new-branch-name> | Rename a branch (local). (file) |
grba <new-branch-name> | Rename a branch (local and remote). (file) |
gl | Show git log. (git log ) |
glp | Show pretty git log. (file) |
gdof | Remove all .orig files from project. (find . -name "*.orig" | xargs rm -rf ) |
gfi <file> | Force git to ignore a file. (git update-index --assume-unchanged <file> ) |
gurl | Show git repository URL. (file) |
guser | Show git user information. (file) |
gst | Create new stash with default message. (git stash ) |
gstl | List all stashes. (git stash list ) |
gstm | Create new stash with custom message. (git stash save "<message>" ) |
gstw | Show stash diffs. (git stash show <stash_id> ) (file) |
gsta | Apply stash. (git stash apply <stash_id> ) (file) |
gstd | Drop specific stash. (git stash drop <stash_id> ) (file) |
gg "<message>" | Add all changes, then commit and push them. (git add --all && git commit -m "<message>" && git push ) (file) |
gu <file> ... | Remove files from staging area. (git reset HEAD <file> ) |
pve | Show the current Python virtual environment name. (file) |
If you like to tweak things more in-depth, like special characters and such, you can create environment variables. These variables override any value found in FancyGit default configuration.
Example:
You want to change the branch icon, because you are using a different console font and the icon is on a different character position inside the font. Simply create the correspondent environment variable.
For sure, you will likely have changed the symbol:
# Branch icon.
FANCYGIT_ICON_LOCAL_REMOTE_BRANCH="ξ "
Here you can see a list of available environment variables FancyGit will search and replace:
# Path is a git repository
FANCYGIT_ICON_GIT_REPO
# Only local branch icon.
FANCYGIT_ICON_LOCAL_BRANCH
# Branch icon.
FANCYGIT_ICON_LOCAL_REMOTE_BRANCH
# Merged branch icon.
FANCYGIT_ICON_MERGED_BRANCH
# Staged files.
FANCYGIT_ICON_HAS_STASHES
# Untracked files.
FANCYGIT_ICON_HAS_UNTRACKED_FILES
# Changed files.
FANCYGIT_ICON_HAS_CHANGED_FILES
# Added files.
FANCYGIT_ICON_HAS_ADDED_FILES
# Unpushed commits.
FANCYGIT_ICON_HAS_UNPUSHED_COMMITS
# Path is a python virtual environment
FANCYGIT_ICON_VENV
Thanks goes to these wonderful people (emoji key):