Install Git On Mac Catalina
There are several ways to install Git on a Mac. The easiest is probably to install the Xcode Command Line Tools. On Mavericks (10.9) or above you can do this simply by trying to run git from the Terminal the very first time. $ git -version. If you don’t have it installed already, it will prompt you to install it. Beginner's Setup Guide for Git & Github on Mac OS X. There is an updated version of this post for OS X 10.9. While the steps below should still work, I recommend checking out the new guide if you are running 10.9! There are already plenty of guides that explain the particular steps of getting Git and Github going on your mac in detail.
Question or issue on macOS:
Does anyone know how to install gitk on Mac?
From their official website, it seems gitk comes with git, but the version of my git (git version 1.7.12.4 (Apple Git-37)) does not come with gitk.
brew install gitk does not work for gitk.
Install Git On Mac Catalina Update
Version info (copied from comments):
How to solve this problem?
Solution no. 1:
Correct, the 1.7.12.4 (Apple Git-37) does not come with gitk. You can install a more recent version of git + git-ui as a separate formula by using brew. More thorough instructions located here: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ (see this commit extracting git-gui/gitk into its own formula: https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706)
Run the following commands at the terminal:
If you get an error indicating it could not link git, then you may need to change permissions/owners of the files it mentions.
Once completed, run:
And make sure it shows:
If it does not, run:
And make the path change to put /usr/local/bin earlier in the path. Now, gitk should be on your path (along with an updated version of git).
Solution no. 2:
I just had the same problem and solved it as follows:
- Download the official git package for Mac from http://git-scm.com/download/mac
- Install the package. This places all the binaries in /usr/local/git/bin.
- Optionally run the included script to make gitk accessible outside of terminals
- Either add /usr/local/git/bin to your PATH or use an alias (
alias gitk='/usr/local/git/bin/gitk'
)
Solution no. 3:
If you already have git installed via homebrew, you can just do upgrade:
The one at local/bin will have gitk
Solution no. 4:
Git Mac version comes without gitk
but if you dobrew install git
you get instant access to gitk
.
I’m using MAC sierra 10.12.5
Edit: This doesn´t work anymore, you must install brew install git-gui
Solution no. 5:
I had the same issue. I installed gitx instead.
You can install gitx from here.
Download the package and install it. After that open the gitk from spotlight search, goto the top left corner. Click on GitX and enable the terminal usage.
Goto your repo and simply type:
It will open the Gui.
User manual:
http://gitx.frim.nl/user_manual.html
Solution no. 6:
There are two ways to fix this:
- Unix Way (simple and recommended)
- Homebrew Way
1. Unix Way: In 4 simple steps
- Execute
which git
in the terminal to know the location of yourgit
executable. Open that directory & locategitk
inside thebin
folder. Copy the path — typically/usr/local/git/bin
- Edit your
~/.bash_profile
to add the location of localgit
&gitk
in the paths or, simply copy-pasta from the sample written below.
Sample bash_profile
:
If you don’t have a bash_profile
want to learn how to create one, then click here.
- This step is relevant if you’re using El Capitan or higher & you run into an unknown color name “lime” error. Locate
gitk
executable (typically at/usr/local/bin/gitk
), take a backup & open it in a text editor. Find all occurences oflime
in the file & replace them with'#99FF00'
. - Reload bash:
source ~/.bash_profile
Now, run gitk
2. HomeBrew way
Updates – If you do not have homebrew
on your mac, get it installed first. It may require sudo
privileges.
brew update
brew doctor
brew link git
- added
/usr/local/Cellar/git/2.4.0/bin
to path & then reload bash & rungitk
- No luck yet? Proceed further.
- Run
which git
& observe if git is still linked to/usr/bin/git
- If yes, then open the directory & locate the was a binary executable.
- Take its backup, may be save with a name git.bak & delete the original file
- Reload the terminal –
source ~/.bash_profile
Solution no. 7:
You can also get gitk
with the git
from MacPorts.
Solution no. 8:
What I ended up doing was: brew info git
Which gave me info that git was cloned into: /usr/local/Cellar/git/1.9.0
So I just added: /usr/local/Cellar/git/1.9.0/bin to the beginning of my PATH env variable.
Note: I don’t know how to use homebrew… just want to get going quickly as I have other things to do… this basically gets gitk running for me so I’m sticking to it for now. (probably not the way to work with homebrew though).
Solution no. 9:
If you happen to already have Fink installed, this worked for me on Yosemite / OS X 10.10.5:
fink install git
Note that as a side effect, other git commands are also using the newer git version (2.5.1) installed by Fink, rather than the version from Apple (2.3.2), which is still there but preempted by my $PATH.
Solution no. 10:
First you need to check which version of git you are running, the one installed with brew should be running on /usr/local/bin/git , you can verify this from a terminal using:
In case git shows up on a different directory you need to run this from a terminal to add it to your path:
After that you can close and open again your terminal or just run:
And voila! In case you are running on OSX Mavericks you might need to install XQuartz.
Hope this helps!
Categories: r Tags: lightgbmboostedtreemethodshowto100DaysToOffload
In this walkthrough Iinstall lightgbm on the latest version of R on an older model macBook Pro withMacos Catalina 10.15.5 and I’m using homebrew.
The world of boosted tree models is growing over the past 4 years, the firstrevolution was with ‘XGBoost’ (eXtreme Gradient Boosting) in 2016, followed by‘lightGBM’ (or LGBM) from January 2017 and later that year ‘catboost’. To usethese C++ libraries in R you have to install them, and that process is slightlydifferent for different architectures.
Prep
I’m also using the amazing RSwitch tool for the Macto switch R versions: from 4.1.0 “experimental version”, to the latest stable versionR 4.0.2 ‘Taking off again’ and an older version beforethat R 3.6.3 (2020-02-29) ‘Holding the Windsock’.I’m trying to install this library on all R versions, but if you use one versionof R, this RSwitch tool is not necessary.
I’m mentioning all this because sometimes these things are really difficult todebug under different operating systems, and different R versions.For work I installed lightGBM on a macbook a year ago, and it was a lot more work then.
Install Git On Mac Catalina Download
Installation
I’m following the instructions at lightgbm.readthedocs.ioand you should too.
First I download the code to my computer:
I deleted the lightGBM folder and re ran the git clone command.
Continuing the installation: going into the lightGBM folderand executing the build_r.R
script.
And a failure, I do not have openMP (a multithreading library) installed brew install libomp
.I did have it installed, it seems, but it wasn’t linked brew link --overwrite libomp
.This was a bit aggressive, it overwrites all links to libomp. I may have brokenthings later, but the installation continues and is successful.
(Re)start your R session and check if you can load the library library(lightgbm)
.
Installing on multiple R versions using RSwitch
I than used RSwitch to switch R version to an older version of R andreran the Rscript build_r.R
command in the same folder.The process reruns the installation and because RSwitch switches the R versionthe package is now installed in the older R version location:the script spews out* installing to library ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library’
(Re)start your R session and check if you can load the library library(lightgbm)
.once finished and verifiedI switch to R3.6 and rerun the script again.It now installs in* installing to library ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library’
And you are done.
How to install lightgbm with renv
renv builds a separate libraryfor your project. This is cool, because it allows you to use different packagesthat do not influence each other. However starting a new project with renvdoes not have lightgbm installed.
I’ve found the easiest is to use setwd()
in your R console to move to theLightGBM
folder and then ssource('build_r.R')
this will build the packageagain and place it in the correct library.
I thought there would be issues with different versions of R, but the main issuesare related to architecture: system libraries that you have to install on macos.After this installation the installation of the R wrapper is not really a bigissue anymore, at least not for R 3.6, 4.0 and 4.1 (at the time of writing).
References
- Find more polished R tutorials by me in this tutorial overview page on my main blog feed
- find other posts about these gradient boosted tree methods on this website under the tag boostedtreemethods
I’m publishing this post too as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com, post - 16/100
Find other posts tagged #100DaysToOffload here