Regardless of local or global, but with global is recommended, add the following block to. In other words, let’s say you have the same alias defined in local and global configurations, then the local definition would be used in for that specific repo. Perhaps worth noting that alias, or all Git configurations for that matter, are first set using local configurations, and then globally if not specified in locally. 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. 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Ģ.Download the latest Git for Mac installer.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. To switch shells, adjust the Default Terminal under Preferences > Terminal.The first thing is first - installation. PowerShell and Bash are currently supported for Windows. To switch shells you’ll need to set the new shell as default in your operating system settings and restart your computer for auto-complete to continue working as expected. ZSH and Bash are currently supported for Mac and Linux. Setting the default terminal on Mac and Linux Navigate to Preferences > Terminal to change your Terminal preferences. Clicking this toolbar will also toggle the panel on/off. gk -help: shows the list of gk commands.Ī toolbar above the panel will display the current repo name, branch, tag, and number of changes pending to pull/push.If only one SHA is provided, it will be compared with HEAD. If no SHAs are provided, it will use your WIP and HEAD. gk diff: shows changes between commits.gk history and gk blame: opens the history/blame panel for a specific file.Same behavior as the gk panel, but additionally it will return to the graph if you’re in a different view, and has subcommands for toggling the graph columns with the keyboard. Also has parameters to reposition the panel top/bottom/left/right. gk panel: toggles the visualization panel.You can access GitKraken CLI specific commands by typing gk.Īs well as suggestions for additional parameters.ĭifferent views can be accessed using the gk CLI program in the Terminal: You may need to uninstall or disable these programs before using the Terminal. Note: Other auto-complete programs can cause the Terminal auto-complete suggestions to not work.
0 Comments
Leave a Reply. |