

If needed later, then add unique alias to a specific project. gitconfiglocated in the root of a repository (i.e., /.gitconfig).įor aliases, typically makes the most sense to add to global configurations. Notice I referred to the configurations as being ‘global’ - ~/.gitconfig are configurations applied system-wide, and project-specific configurations get handled in. Now, in the current repo, the prompt would look like the following: matlab (master )]$Īliases, especially for Git, are typically worthwhile! If there is nothing else, at least add this feature to your global Git configurations.

One of the best customization for Git, in my opinion, is displaying branch information in the terminal.įor this, simply add the following lines of text to ~/.bash_profile file: parse_git_branch() export PS1="$NO_COLOUR $BLUE\u$SSH_FLAG:$YELLOW\w$NO_COLOUR: \n$GREEN\$(parse_git_branch) $BLUE\\$ $NO_COLOUR" branch = auto diff = auto status = auto current = yellow reverse local = yellow remote = green meta = yellow bold frag = magenta bold old = red bold new = green bold added = yellow changed = green untracked = cyan For this, copy and paste the following into file ~/.gitconfig. Mac terminals can be configured to use colors to improve the display. Most definitely, specific components of Git are best displayed in color, making it easier to identifier different components and, thus, more comfortable to read.įrom the terminal run the following set of commands (i.e., from any folder): git config -global color.status auto git config -global color.branch auto git config -global color.interactive auto git config -global color.diff auto Unless you are reading this from a monochrome display, let’s take advantage of some of the color features for git. Regardless, let’s keep it simple and neat - setup a Git color scheme and branch information displayed in the terminal.
#GET GIT FOR MAC PASSWORD#
These details associated with any commits that you create: git config -global user.name "Ava Paris" git config -global user.email (Optional) To remember your Git username and password when working with HTTPS repositories, configure the git-credential-osxkeychain helper. Configure your Git username and email using the following commands, replacing Ava’s name with your own. Open a terminal and verify the installation was successful by typing and running the following in the terminalĢ.
#GET GIT FOR MAC FOR MAC#
#GET GIT FOR MAC INSTALL#
The easiest way to install Git on a Mac is via the stand-alone installer: Open the terminal and install Homebrew by running the following command: /usr/bin/ruby -e "$(curl -fsSL )" For the sake of having the brew package manager installed, I recommend using Homebrew. It can be done a couple of different ways.
