bill-auger / git-branch-status

A shell script that prints out pretty git branch sync status reports
GNU General Public License v3.0
237 stars 34 forks source link

How to install the executable on a Mac? #13

Closed mikewojnowicz closed 3 years ago

mikewojnowicz commented 3 years ago

The README has a usage section which is clear and helpful. But how do I "install" this?

Context: In terms of exploiting repos, I have previously simply used Python packages, in which case I might clone a repo and install it via pip, perhaps to a virtual environment.

But I am not sure how to "install" executables. If I clone this repo, what do I need to do to make this program accessible to all of my own git repos? Would I want to make it globally accessible on my system (my default preference, as I have about 40 repos on my machine where I would want to use this command)?

I am on a Mac.

Sorry for the total n00b question.

joeytwiddle commented 3 years ago

Here is one approach:

echo $PATH

Decide where you want to install it. /usr/local/bin is a good option, if that's already on your PATH.

Move the filegit-branch-status into that folder, or perhaps better, make a symlink into the repo:

# Assumes your current working directory (PWD) is inside the git clone

ln -s "$PWD"/git-branch-status /usr/local/bin/

Finally, make sure it is executable. (It probably is already.)

chmod a+x git-branch-status
bill-auger commented 3 years ago

it can also be installed with the npm package manager, similarly to pip

$ npm i git-branch-status
mikewojnowicz commented 3 years ago

Thank you :-) 👍