Upgrading to latest version of Git - macos

Trying to upgrade to the latest version of Git. because I get the message "Your version of git is 1.8.5.2. Which has serious security vulnerabilities" I have upgraded via homebrew but it still showing the old version not the new version 2.4.1. Ran the following commands (using osx yosemite version 10.10.1)
brew update
Updated Homebrew from 6cb91e45 to bc541b9d.
==> New Formulae
apache-drill gumbo-parser mlogger
blockhash hebcal moe
==> Deleted Formulae
datamash git-latexdiff shell.fm texwrapper
dupx lilypond sslscan
brew install git
==> Downloading https://homebrew.bintray.com/bottles/git-2.4.1.yosemite.bottle.t
######################################################################## 100.0%
==> Pouring git-2.4.1.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The "contrib" directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/git/2.4.1: 1370 files, 31M
but when i do git --version it gives me git version 1.8.5.2 (Apple Git-48). However brew upgrade git gives me
Error: git 2.4.1 already installed
the command which git gives me
/usr/local/bin/git
how can i access the latest version of Git?

just needed restarting now getting 2.4.1!

Related

SSL Error installing rbenv on Mac Catalina

I'm trying to install rbenv on Mac Catalina Version 10.15.7 using homebrew and I get this error:
gaston.ramos#AR-IT10128 ~ % brew install rbenv
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 4 formulae.
==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.catalina.bottle.4.tar.gz
Already downloaded: /Users/gaston.ramos/Library/Caches/Homebrew/downloads/c473cc5dd3e84f64b99973078d9d9caae87e7810e6e771008e63d651bbe8007f--autoconf-2.69.catalina.bottle.4.tar.gz
==> Downloading https://github.com/rbenv/ruby-build/archive/v20201221.tar.gz
##O#- #
curl: (35) error:1400410B:SSL routines:CONNECT_CR_SRVR_HELLO:wrong version number
Error: Failed to download resource "ruby-build"
Download failed: https://github.com/rbenv/ruby-build/archive/v20201221.tar.gz
Any idea on how to solve this? It seems that there is an SSL error when brew tries to download ruby-build
Thanks.
Use a different mirror
foo#bar$ env HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles brew install rbenv

brew cannot find ANY packages

I just got my Mac Pro from the shop after hard drive failure. I am trying to install my environment again.
I installed homebrew from the current link on the homebrew website:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
but I cannot install ANY package. Brew cannot find ANYTHING.
~ brew install rbenv
Error: No available formula with the name "rbenv"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
What is wrong?
I had the same issue and I was able to solve it by running the doctor command and follow the steps which need to be updated there.
My homebrew-core was not at the master branch.
brew doctor
git -C $(brew --repo homebrew/core) checkout master
And that's it. After that, I was able to run the rbenv install command.
brew search result
$ brew search rbenv
==> Formulae
rbenv rbenv-bundle-exec rbenv-chefdk rbenv-default-gems rbenv-vars
rbenv-aliases rbenv-bundler rbenv-communal-gems rbenv-gemset rbenv-whatis
rbenv-binstubs rbenv-bundler-ruby-version rbenv-ctags rbenv-use
install rbenv
$ brew install rbenv
==> Downloading https://github.com/rbenv/ruby-build/archive/v20200819.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20200819
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/rbenv-1.1.2.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Installing dependencies for rbenv: ruby-build
==> Installing rbenv dependency: ruby-build
==> ./install.sh
==> Caveats
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.
To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
==> Summary
🍺 /usr/local/Cellar/ruby-build/20200819: 509 files, 253.6KB, built in 5 seconds
==> Installing rbenv
==> Pouring rbenv-1.1.2.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/rbenv/1.1.2: 36 files, 65KB
==> Caveats
==> ruby-build
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.
To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
version test
$ rbenv --version
rbenv 1.1.2

Homebrew not updating the version of my package

I am a homebrew novice and have a tap with a single package, mark-on-mac (https://github.com/sjbonner/homebrew-tap). The tap is simply a wrapper for the executable of Program MARK for the analysis of mark-recapture data that defines the location for the gcc libraries.
I have updated the formula several times (now on v0.0.7), but the command
brew install mark-on-mac
always finds and installs version v0.0.3. In order to install the up-to-date version I have to specify my tap
brew install sjbonner/tap/mark-on-mac
Here's a listing showing the behaviour when I don't and then do specify the tap
Simons-MBP:homebrew-tap sbonner$ brew info mark-on-mac
mark-on-mac: stable 0.0.3
Command-line version of Dr. Gary White's mark-recapture software
http://warnercnr.colostate.edu/~gwhite/mark/mark.htm
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mark-on-mac.rb
Simons-MBP:homebrew-tap sbonner$ brew install mark-on-mac
==> Downloading https://github.com/sjbonner/mark-on-mac/archive/v0.0.3.tar.gz
==> Downloading from https://codeload.github.com/sjbonner/mark-on-mac/tar.gz/v
0.8# 2.1######## 12.1############### 22.2###################### 31.3########################### 38.5################################## 48.4########################################## 59.2################################################# 69.1######################################################## 79.0################################################################ 89.7######################################################################## 100.0%
🍺 /usr/local/Cellar/mark-on-mac/0.0.3: 5 files, 4.0MB, built in 6 seconds
Simons-MBP:homebrew-tap sbonner$ brew uninstall mark-on-mac
Uninstalling /usr/local/Cellar/mark-on-mac/0.0.3... (5 files, 4.0MB)
Simons-MBP:homebrew-tap sbonner$ brew info sjbonner/tap/mark-on-mac
sjbonner/tap/mark-on-mac: stable 0.0.7
Command-line version of Dr. Gary White's mark-recapture software
http://warnercnr.colostate.edu/~gwhite/mark/mark.htm
Not installed
From: https://github.com/sjbonner/homebrew-tap/blob/master/mark-on-mac.rb
Simons-MBP:homebrew-tap sbonner$ brew install sjbonner/tap/mark-on-mac
==> Installing mark-on-mac from sjbonner/tap
==> Downloading https://github.com/sjbonner/mark-on-mac/archive/v0.0.7.tar.gz
Already downloaded: /Users/sbonner/Library/Caches/Homebrew/downloads/a0310eb4eafbf40481bd5f010d2e369da2f91c41a203b508c340bfad893fd501--mark-on-mac-0.0.7.tar.gz
🍺 /usr/local/Cellar/mark-on-mac/0.0.7: 5 files, 4MB, built in 3 seconds
Removing: /Users/sbonner/Library/Caches/Homebrew/mark-on-mac--0.0.3.tar.gz... (1.7MB)
Simons-MBP:homebrew-tap sbonner$
Can anyone tell me why this is happening? Why does v0.0.3 get installed by default? How can I stop this?
Thanks in advance!
Simon
It seems the local repository sjbonner/tap is outdated. You need to sync your local repo with the remote one.
# cd into the local repo
cd "$(brew --repo sjbonner/tap)"
# find out the latest commit locally
git log -s -1
# compare the commit with your remote repo
# if the repo is outdated, run
brew update

WARNING: Your version of git is 1.9.3. has serious security vulnerabilities

I received a warning regarding serious security vulnerability of git 1.9.3 during deploy to Heroku
I tried to update git via homebrew but found that git was not originally installed via homebrew
Then I installed it via homebrew
brew update
brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.2.1.mavericks.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The "contrib" directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/git/2.2.1: 1356 files, 31M
After that when I checked git version it remained the same
⇒ git --version
git version 1.9.3 (Apple Git-50)
It seems to me homebrew installed git in folder /usr/local/Cellar/git/2.2.1
And finally my question:
what should I do to start using homebrew git instead of the original git?
⇒ which git
/usr/bin/git
⇒ git --version
git version 1.9.3 (Apple Git-50)
You need to rename original git at /usr/bin/git, e.g.
sudo mv /usr/bin/git /usr/bin/git-original
Now check location and version again
⇒ which git
/usr/local/bin/git
⇒ git --version
git version 2.2.1
Add a symlink for backward compatibility (in case your IDE uses direct location to git)
sudo ln -s /usr/local/bin/git /usr/bin/git
Like Jubobs commented, you can simply add it to your path like so:
echo 'export PATH="/usr/local/git/bin:$PATH"' >> ~/.bash_profile
Just change ~/.bash_profile to whatever bash profile file you're using.

mosh: dyld: Library not loaded: /usr/local/lib/libprotobuf.7.dylib

I really like mosh (http://mosh.mit.edu/) but after a brew upgrade it stopped working, yielding the below error.
> mosh example.com
dyld: Library not loaded: /usr/local/lib/libprotobuf.7.dylib
Referenced from: /usr/local/bin/mosh-client
Reason: image not found
Died at /usr/local/bin/mosh line 201.
After some digging around I realised that this was due to protobuf had been upgraded and that mosh is hardcoded to use protobuf 2.4.1.
So all I had to do was revert from protobuf 2.5.0 to 2.4.1. On Mac with homebrew this is done by the following steps:
> brew versions protobuf
2.5.0 git checkout 019364d /usr/local/Library/Formula/protobuf.rb
2.4.1 git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> brew unlink protobuf
> brew link protobuf
You shoud reinstall use:
https://mosh.mit.edu/#getting
DO NOT use brew, it work for me on MAC OSX 10.9.5
You could also update brew and then upgrade mosh to 1.2.4:
$ brew update
...
$ brew upgrade mobile-shell
==> Upgrading 1 outdated package, with result:
mobile-shell 1.2.4
==> Upgrading mobile-shell
==> Downloading http://mosh.mit.edu/mosh-1.2.4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/mobile-shell/1.2.4
==> make install
🍺 /usr/local/Cellar/mobile-shell/1.2.4: 12 files, 1004K, built in 41 seconds
Had same issue, next line helped me:
brew reinstall protobuf

Resources