Skip to content

That's a simple prompt changer to show a few cool git informations about your repository on terminal. You can choose among different styles and enjoy all the aliases it provides you. Feel free for contributing, pull requests and issues are always welcome! ;)

License

Notifications You must be signed in to change notification settings

EDIflyer/fancy-git

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

All Contributors

Build PRs Welcome made-with-bash MIT Licence GitHub forks GitHub stars

logo

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

πŸ’˜ Installing

curl -sS https://raw.githubusercontent.com/diogocavilha/fancy-git/master/install.sh | sh

πŸ’” Uninstalling

curl -sS https://raw.githubusercontent.com/diogocavilha/fancy-git/master/uninstall.sh | sh

βœ”οΈ After installing

  1. Change your terminal font 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 running fancygit --fonts-install or even installing the ttf file which is placed at ~/.fancy-git/fonts/.
  2. Restart your terminal.

Run fancygit -h to check FancyGit help.

πŸ’… Git suggested config

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.

πŸ‘€ Overview

As a picture is worth a thousand words...

001 002 003 004 005 006 007

Working on a Python virtual environment? python_venv

🎨 Themes and color schemes

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)
Theme default

fancygit --color-scheme-dracula
Color scheme dracula

fancygit --color-scheme-batman
Color scheme batman

fancygit --color-scheme-robin
Color scheme robin

fancygit --color-scheme-superman
Color scheme superman

fancygit --color-scheme-light
Color scheme light

fancygit --color-scheme-neon
Color scheme neon

fancygit --color-scheme-cga
Color scheme cga

fancygit --theme-human (default color scheme: --color-scheme-human)
Theme human

fancygit --theme-simple (default color scheme: --color-scheme-simple)
Theme simple

πŸ”— Separators styles

You can type fancygit --separator<TAB> so you can see all the available separator styles for you to use.

‼️ Important ‼️

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-default
Separator default

fancygit --separator-blocks
Separator blocks

fancygit --separator-blocks-tiny
Separator blocks-tiny

fancygit --separator-curve
Separator curve

fancygit --separator-fire
Separator fire

fancygit --separator-lego
Separator lego

fancygit --separator-paint
Separator paint

πŸ’« Feature switchers

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.

🧰 Commands

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 --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 --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.

🧰 Aliases

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)

βš™οΈ Advanced tweaking - override some default config values

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:

# 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

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Holger Pandel

πŸ’»

Marvin Kweyu

πŸ’»

Foundjem

πŸ’»

Rafael Martins

πŸ’»

OtΓ‘vio Augusto

πŸ“–

Roger Carhuatocto

πŸ““

Rafael Pereira

πŸ““

Tom Halliley

πŸ’΅

Sven Finke

πŸ€”

ibury08

πŸ’»

Josip Trupina

πŸ’»

David Quartino

πŸ’»

Borjovsky

πŸ’»

β˜• Buy me a coffee!

Donate_with_PayPal

About

That's a simple prompt changer to show a few cool git informations about your repository on terminal. You can choose among different styles and enjoy all the aliases it provides you. Feel free for contributing, pull requests and issues are always welcome! ;)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%