Coder Social home page Coder Social logo

juanrivera32 / git-beautify-for-macos-terminal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmilr/git-beautify-for-macos-terminal

0.0 1.0 0.0 713 KB

An easy-to-use set of config files to beautify Git in your MacOS or OS X terminal. If you find it hard to parse a jumble of mono-colored type on your command line, this set-up can help you tame the ugly bash beast.

License: MIT License

Shell 100.00%

git-beautify-for-macos-terminal's Introduction

GitHub release  Platform  GitHub issues  GitHub license  Code of Conduct 

Git Beautifier For MacOS & OS X Terminal

Transform your command line from ugly and painful to delightful and easy-to-read.

Setup

First things first, you'll want to install a nice color theme for your terminal. The one in the screenshot above is called Monokai Soda Custom, and you'll find it included in the repo. I based it off of the most excellent Monokai Soda theme, found here.

Load the theme by opening up your mac terminal and navigating to Preferences > Profiles > Import, and then set the theme as your default.

Now log into your bash terminal and punch in the following git config commands. You should be able to copy & paste them as a full block and just hit return. This tells git that we want color in our UI, and sets specific colors for specific file status types.

git config --global color.ui true
git config --global color.status.changed "blue normal"
git config --global color.status.untracked "red normal"
git config --global color.status.added "magenta normal"
git config --global color.status.updated "green normal"
git config --global color.status.branch "yellow normal bold"
git config --global color.status.header "white normal bold"

Now you'll need to update your .bash_profile with the contents of the bash_profile included in the repo. The easiest way to do this will be to first show all hidden files on your system, because .bash_profile is usually set to invisible. You can show hidden files by pasting the following command into your terminal.

defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app

Once your finder reloads, you should be able to see all hidden files. In the finder, navigate to Users/YourUserNameHere, and you should see .bash_profile listed in the directory. If you don't, you simply have to create one yourself (just place an empty text file there and name it .bash_profile.)

Either way, open your .bash_profile and paste in the contents of the bash_profile included in this repo (paste it beneath any other content that's already in there.) Now save the file.

Congratulations! Your .bash_profile now includes all the code that your terminal needs to display it's UI in color, including a nicely colorized bash -ls command, a customized command prompt, and aliases for a number of highly-readable git log formats. You can customize these to your heart's content, but hopefully this will give you a solid jumping-off point.

Now let's hide those invisible files again, by pasting the following command into the terminal and hitting return.

defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app

Restart the terminal app, and you're ready to go!

Usage

With any luck, you should now have a nice looking command line terminal running on your Mac. If you like, point the terminal to one of your git repositories and take a few of the included git log aliases for a ride.

log

Type in 'log' and hit return, and you should get a nicely formatted basic log, starting with a list of refs on top, followed by all your commits.

Now explore the other colorized aliases if you like:

  • 'log' displays a basic git log with single-line commit messages only (this is the one I use most often.)
  • 'logv' displays a more verbose log, including email addresses for commit authors.
  • 'logg' displays an ascii graph of your branches, along with basic log info.
  • 'loggv' displays an ascii graph of your branches, along with more verbose log info.
  • 'logm' displays multi-line commit messages.
  • 'refs' displays your repo's refs and abbreviated hashes.
  • 'remotes' display your repo's remotes and remote branches.

Lastly, type in the trusty '-ls' bash command and you should see a nicely colorized list of files, directories, etc.

Well, that's it. You're good to go!

Questions? Drop Us a Line!

Contact

License

Distributed under the MIT license. See LICENSE for more information.

Thanks for stopping by!

git-beautify-for-macos-terminal's People

Contributors

cmilr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.