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

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.

Related

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$

gitconfig error mac OS X 10.10

I’m trying to setup the global config settings for my git installation and when I run the command
git config —global user.name “myname”
I get the following error msg:
error: could not lock config file /Users/vc/.gitconfig: No such file
or directory
my git version on my mac git version 1.9.3 (Apple Git-50)
How can I fix this error?
I found the solution on the following site:
http://coolestguidesontheplanet.com/install-update-latest-version-git-mac-osx-10-9-mavericks/
Under the article, but before you do that, please delete any gui based git installation and then download the latest version of git and follow the instructions below under the title.
Trumping Xcodes Older Git
If you have Xcode already installed and have installed command line tools then you alreay have Git, probably an older version which is distributed with Xcode this is installed in:
/usr/local/bin
To run the lastest version you need to adjust your shell path:
/usr/local/git/bin/git
You need to add add the above path to the beginning of your shell path to take precedence over the other path, the path will be set in either .bashrc or .bash_profile in your home directory.
So add in
/usr/local/git/bin
to the path similar to the below:
export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:$PATH"
Restart or reload the Terminal and the newer Git version will now be used.

Updated Git but still showing old version

I downloaded and installed Git 1.8.4.2 from this link: http://git-scm.com/downloads. However, when I run git --version from the Terminal I get:
[~/workspace/ruby]: git --version
git version 1.7.4.4
I've tried restarting the terminal and my computer. I then tried using the info at https://code.google.com/p/git-osx-installer/wiki/Uninstall. I did the following in the terminal from within /usr:
sudo rm -rf /usr/local/git
sudo rm /etc/paths.d/git
sudo rm /etc/manpaths.d/git
I then ran the new git .dmg file again but am still getting 1.7.4.4 when I run git --version. I suppose there's something going on here with the Mac filesystem that I don't understand. Any help would be greatly appreciated!
Run the command:
which git
You'll probably see /usr/bin/git -- the Apple supplied version. This will be because /usr/bin appears in your PATH environment variable before /usr/local/git/bin. You can verify this by running the command:
echo $PATH
If that is the case then run this command:
export PATH=/usr/local/git/bin:$PATH
and then try git --version again. You should now get 1.8.4.2. This hasn't fixed it permanently yet though. You'll need to add the export PATH=... line to your ~/.bashrc so that it gets set for every shell.

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.

Trying to install git on OSX: cannont exec 'git-credential-osxkeychain': Permission denied`

I'm attempting to install Git on my new MBP and am following the documentation # https://help.github.com/articles/set-up-git.
I seem to have hit a snag at the point where it says : If you do not have the helper, you can download it and copy it to /usr/local/bin
I navigated to /usr/local/bin in terminal and did a sudo wget [link to osxkeychain]. When I try to do a git config --global credential.helper osxkeychain I get a fatal: cannont exec 'git-credential-osxkeychain': Permission denied.
What did I do wrong?
Thanks!
Tre
Download the git-credential-osxkeychain file to your desktop(!).
Open the Terminal application.
Type in the following:
sudo cp ~/Desktop/git-credential-osxkeychain /usr/local/bin/git-credential-osxkeychain
sudo chmod 755 /usr/local/bin/git-credential-osxkeychain
sudo git config --global credential.helper osxkeychain
Test it with:
sudo git credential-osxkeychain
See the sudo prefix? It seems to be required for the credential stuff... It should now output Usage: git credential-osxkeychain <get|store|erase>
Make the downloaded file executable:
chmod 755 git-credential-osxkeychain
Homebrew's git package sets this up; just:
brew install git
and you're away.
Tried sudo?
/usr/bin is protected. Or you could try downloading git executables somewhere on your laptop and add that location to your PATH.
One of the common mistakes made by people starting on git is that they have the wrong executable for the operating system.
Please make sure that when you go to git help setup page you click on the right link
for example the following link has MAC | WINDOWS | LINUX | ALL options in the top of the page which is small enough to be ignored by many.
https://help.github.com/articles/set-up-git
This has happened to many of my team member to install osx for ubuntu and end up getting the error mentioned above

Resources