2

I've installed Github for Mac.

I've realised that I need to get to the command line to do some stuff.

There is an option in Guthub for Mac to install a command line. All this seems to do is create an alias called Github in /usr/local/bin that points back to the Github for Mac application.

Double clicking it opens a terminal window and then Github for Mac.

Any ideas how to get Git to work in a command line?

Its a relatively clean version of Lion OS X

Jon
  • 38,814
  • 81
  • 233
  • 382
  • You now have another option to install Git with the updated "GitHub for Mac": see my answer below. – VonC May 21 '13 at 07:11

5 Answers5

3

Git is included in the command line tools package provided by Apple that can be downloaded at https://developer.apple.com/downloads/index.action

It is also included with Xcode, which can be downloaded from either the Mac App Store or from the above link.

Assuming you'd rather not install either of these you can also obtain Git by downloading it from http://git-scm.com/downloads

Hope that helps.

tgt
  • 1,308
  • 1
  • 10
  • 16
2

https://help.github.com/articles/set-up-git#platform-mac

Should walk you though installing it.

howderek
  • 2,224
  • 14
  • 23
  • Are you saying Github for Mac does not include Git? – Jon Jun 12 '12 at 19:13
  • I believe it uses a library that allows it to interact with things like Git. So yes. – howderek Jun 12 '12 at 19:16
  • 1
    Yeah, I just downloaded Github for Mac (which I hadn't heard of before) and I can confirm that it does not, in fact, include the git binaries. – ebneter Jun 13 '12 at 02:00
2

I highly recommend installing Homebrew, which does a great job of keeping up with the latest git releases.

Once Homebrew is installed, it's as simple as:

brew install git
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
leedm777
  • 23,444
  • 10
  • 58
  • 87
  • I agree homebrew is great. Remember if you have xcode installed, it includes (a slightly older version of) git which can conflict with the homebrew version. – spuder Mar 31 '13 at 04:31
1

Note that, from May 2013, you now have with "GitHub for Mac" both:

  • the GUI
  • the CLI (Command-Line Interface)

See the blog post "Installing Git from GitHub for Mac"

you can now easily install Git for use on the command line, without needing to download any separate packages.

Even the git updates are taken care for you:

And whenever we update the version of Git included with GitHub for Mac, you'll get the changes automatically – no work required on your part!

you may notice some changes to the Preferences window.
On the newly renamed "Advanced" tab, simply click "Install Command Line Tools".

click install

You'll be prompted for an administrator password so that Git can be installed into /usr/local/bin, and then you should very shortly see that it succeeded:

enter image description here

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

GitHub app create many links in /usr/local. Use this command to find all link files from GitHub.

ls -l $(find /usr/local -type l) | grep GitHub.app | awk '{ print $9}'

then rm them.

PS: GitHub also created some directories that cause error when run brew link git, e.g. /usr/local/share/git-core, /usr/local/lib/perl5/site_perl. You should remove them carefully.

Qing
  • 1
  • 1