How to get GIT running on Mac OS X 10.7.5 - macos

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$

Related

How do I access git once I have downloaded it on my Mac OSX 10.6.8

I downloaded Git 2.3.5 Mavericks via http://git-scm.com/downloads. After installation I could not open or find git. So I followed the Read Me instructions that came with git. So I removed stubs:
sudo mv /usr/bin/git /usr/bin/git-system
Then installed Tcl/Tk Aqua. To check if git works I typed this command in my terminal:
$ git config --global user.name "YOUR NAME"
The response was:
Illegal instruction
Please help.

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

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

Git Segmentation fault: 11

I had to reinstall OS X Lion on my Macbook Pro, and upon trying to use git I got an error stating Segmentation fault: 11. No matter what git command I try I get that error. I'm just doing this through the Mac terminal. No fancy programs or anything external.
I uninstalled git and just to make sure it was uninstalled I typed git init and it gave me a command not found message.
I reinstalled git and I'm still getting the segmentation fault message. I get the message regardless of what directory I'm in and what command I use.
I got it to work by uninstalling it again and installing 1.8.1 instead of 1.9.2. I guess OS X Lion doesn't like the latest release.
Try setting an email address in your git config if you haven't done so already - traced errors and that's what fixed it for me.
git config --global user.email "email#example.com"
Working with a Mac OS X Version 10.7.5 (Lion)
Uninstalling Git latest version (2.2.0) and reinstalling Git version 1.8.4.2 worked for me. Here is the download link for git 1.8.4.2
It says snow-leopard but actually works for Lion here is the page with all git-osx-installer
:o)
I had the same problem, I was using (2.12.2) on Windows 7(x64), I downgraded it to (2.12.1) and now everything is working fine.

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.

Git command "git svn rebase" not working with XCode 4.3.1

I have cloned few SVN Project on my system, I used to do "git svn rebase" to sync them up with SVN Repositories. Now after updating XCode to version 4.3.1, this command stopped working.
Executing "git svn rebase" on my mac (v 10.7.3) gives me error "git: 'svn' is not a git command".
I suspect, Apple is no longer installing git-svn with new XCode. Do anybody has any idea, how to fix this issue?
Thanks.
I'm quite sure git-svn never came included in the command line tools but I might be wrong. Anyhow, that's not the point, use macports (or any alike, it just happens I use this one) to get it installed:
$> sudo port selfupdate
$> sudo port variants git-core
Here you're shown the different variants for a given port (in this case git-core), and amongst them there is the one we need:
...
svn: Bi-directional subversion repository support
...
We install it by typing
$> sudo port install git-core +svn
And off you go, you should be able to use git-svn again!

Resources