Issues while trying to run git uninstall.sh on Mac OS - macos

I wanted to try to update Git on my Mac OS to the latest version and it says to run the provided uninstall.sh first. I must confess that I ran the pkg before reading the "Read me". Not sure if that screwed it all up ...
Now I am not big with the terminal and found the following command to run a shell script:
$ sh uninstall
but that resulted in:
/usr/sbin/uninstall: /usr/sbin/uninstall: cannot execute binary file
where I got stuck now.
Any idea what I have to do to resolve this error?

You should run the uninstall.sh packaged with your previous distribution of Git, as explained in "Install and Update to latest version Git on Mac OSX 10.10 Yosemite":
Upgrading Git from a previous version to the latest 2.0.1
If you have previously installed Git you can upgrade to the latest version by uninstalling the previous install using the uninstall.sh file with the installation.
Go through the same process of downloading and mounting and the .dmg – then launch the Terminal.

uninstall and uninstall.sh are two different things. The former is a binary that comes with the os, the latter is a shell script that comes with the package.
Try: sh uninstall.sh instead

Related

Problem installing git subrepo on MacOs bash 5

I was trying to install git subrepo on MacOs with bash 5.0.18 installed. When I source .bashrc, I get error message :
The git-subrepo command requires that 'Bash 4+' is installed. It
doesn't need to be your shell, but it must be in your PATH. You appear
to be on macOS. Try: 'brew install bash'. This will not change your
user shell, it just installs 'Bash 5.x'.
Is git subrepo not compatible with bash 5 or is there any solution to make it work?
https://github.com/ingydotnet/git-subrepo
apparently, I can install it using brew with less hassle:
brew install git-subrepo
It should be a PATH issue, as illustrated by ingydotnet/git-subrepo issue 463
I realized there was a part of my path not being specified which caused this issue.

I'm trying to set up the emscripten SDK on Windows 10 but emcc can't be found

On linux there's no problem but I want to compile my code on windows. I follow the instructions exactly. Specifically, I open a command prompt and run the following in the same directory I cloned the emscripten git repo in to.
git pull
emsdk install latest
emsdk activate latest
emsdk_env.bat
There is suspiciously no output and emcc cannot be found. What could I be doing wrong here?
If you go to the command line and type python --version the version of python installed should come up.
If it doesn't, go to the directory in which python is installed and add this to your PATH.
Restart the command prompt and try python --version again. If you get the version of python, follow the steps you mentioned.
You should get some output.
Let me know if the problem still has not been resolved.
You need to install Python 2.7.12 or newer.
https://emscripten.org/docs/getting_started/downloads.html#windows

How to get GIT running on Mac OS X 10.7.5

I am totally new in this area and tried to download and install Git on my Notebook. As I could not configurate me as a user via the terminal I was doing some research and found out that the latest version of Git might now be ideal for my Mac. So I tried to uninstall Git which I failed to do. I have tried using different commands which I have found in the internet. How can I uninstall or make git usable?!
Information to be found in my Terminal:
macgaia:~ miriam$ which git
/usr/local/git/bin/git
macgaia:~ miriam$ git --version
Segmentation fault: 11
macgaia:~ miriam$

How to update my version of git on OSX 10.8

I'm on OSX 10.8.2 and I'm running git git v1.7.4.4
I just installed git on a remote server and it's version 1.11.x. I'm I would like to be running the same version of the software but I cannot figure out how to update git on my laptop.
I attempted to follow the steps listed here, which instruct to download the git-OSX-installer, run the install (which ran smoothly) and then do:
$ sudo mkdir -p /usr/local/bin
$ sudo ln -s /usr/local/git/bin/git /usr/local/bin/git
But after this I do git --version and it's still 1.7.4.4. Did I just reinstall the same version? Or did I install a newer version somewhere else?
I've been reading similar questions and I think the issue is that OSX ships with an old version of git installed in a different location then where the git-osx-installer or mac ports will put it. But I'm not sure how to correct this. Thanks in advance for your advice.
Update:
which git returns:
/usr/bin/git
echo $PATH returns:
/opt/local/bin:/opt/local/sbin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin
Update2:
ESL ~/Downloads$ export PATH=/usr/local/bin:$PATH
ESL ~/Downloads$ which git
/usr/local/bin/git
ESL ~/Downloads$
ESL ~/Downloads$ git --version
git version 1.8.1.3
It appears I installed the newer git version in local. So should I add the export PATH=/usr/local/bin:$PATH to my .bash_profile? Is it a problem that both versions of git are installed?
I added export PATH=/usr/local/bin:$PATH to the bottom of my ~/.bash_profile and now the new version of git runs.
The best way to update any binary on a Mac OSX machine is to use the package(s) developed specifically for Mac (a .dmg or .pkg download).
In the case of git this is at: http://git-scm.com/download/mac
(clicking on this link should automatically start the download of the latest version of git for Mac).
However, in this case (at least for my 10.8.3 MacBook) this was not quite the whole story: the package installs git in /usr/local/git and then adds that path at the end of $PATH - which defeats the whole purpose IMO.
I have manually modified my .bashrc so as to have something similar to what suggested above:
export PATH=/usr/local/git/bin:$PATH
Once you do that, you should see the correct version of git being picked:
$ git --version
git version 1.8.2.2
Note that this won't work for any app that is launched interactively (eg, via the docking bar) - you'll have to run the additional script provided in the downloaded package; see the README for instructions.
Since /usr/bin shows up before /usr/local/bin in your path, the git executable in /usr/bin will be given precedence.
try this in your shell:
export PATH=/usr/local/bin:$PATH
which git
On a side note, I'd strongly recommend using homebrew for managing installations such as this on macos
I had a similar issue in Cygwin (linux environment compiled for windows). I would do
which git
and it would respond with the correct location of the updated git compiled from source, but wouldn't actually use it until I did
hash -r git
I don't claim to understand what this did or why it had to be done, but after that git --version replied with '1.8.2.rc0.22.gb3600c3' which was clearly no longer the old git shipped with Cygwin. This may not apply to OSX, but give it a shot if which git is locating the updated binary.

Github not installed in terminal os

I downloaded and installed GitHub (latest version) for OS X, installed command line utility under Github in the application and am coming up with an error trying to create my first readme file in a repo entitled "basic-twitbstrap".
Macbooks-MacBook-Pro-2:basic-twitbstrap macbook$ git init
-bash: git: command not found
If they're not installed in standard location, command-line programs need some environment modifications to be called, which consists in adding their directory to the PATH environment variable.
So in your case you need to add /usr/local/github to your path, see how.
I installed the latest version of Ruby Version Manager, then entered 'git' into the Terminal. It came up with a list of usage and common commands.
Now it runs.
Macbooks-MacBook-Pro-2:~ macbook$ git --version
git version 1.7.4.4

Resources