Git For Github Mac Osx Yosemite Without Xcode

If you're like me, you find working on the provided Ubuntu VM to be tortuous and inefficient. It's such a shame to be running an operating system with all of the tools to you need to compile and run simple toy C programs but being forced to use a clunky virtual machine without all your favourite software. Here's what I do to ease the pain.

Mac OS X

This guide was tested on Mac OS X 10.10 Yosemite, but should also work on any version of OS X that Homebrew supports. It should work just fine on Mavericks, plus you get access to valgrind. (valgrind hasn't been ported to 10.10 yet, but it does work on 10.9)

Git

gcc on OS X

The official stand-alone installer for Git on OS X. Operations Management. ERP PLM Business Process Management EHS Management Supply Chain Management. Step 4: Configure Git with GitHub for Mac. Download, install, and launch GitHub for Mac. If you don't have a GitHub account, click on the Sign Up at GitHub.com link in the app, then come back to the app to complete the setup. Mar 07, 2014 After typing the above command, simple close and re-open the terminal, or to re-load your bash profile without closing and re-opening, simply run: source /.bashprofile. Test it works by checking the version of git like so: git -version. – No need to bloat out your Mac anymore if you’re not using XCode 🙂.

By default, if you have Xcode installed, typing gcc into Terminal.app links to the llvm/clang compiler. Although clang is a great, modern compiler it isn't what's specified by the professor and could potentially lead to incompatible code (and lost marks). To avoid this, we can install and run the same (*a slightly newer) version of gcc natively on our Macs.

Homebrew

If you don't already have Homebrew installed, go ahead and do that now. For those of you familiar with Linux package managers, Homebrew is essentially Aptitude (apt-get) for OS X.

From brew.sh:

The installer will guide you through installing any missing dependencies you may have. (Commonly Xcode tools)

Once Homebrew is installed,brew install gcc

And that's pretty much it. But you have to watch out; gcc is actually just clang plus some extra libraries, you need to run gcc-4.9 instead.

Notice how gcc -v spits out something like

Git for github mac osx yosemite without xcode file

Which, clearly, isn't what we want. Notice the slight difference between clang -v and gcc -v.

Whereas gcc-4.9 -v should show something like

Retrieved April 10, 2015. January 7, 2002. Iphone configuration utility for mac yosemite.

Your Mac also needs at least 2GB of memory and 8.8GB of.introduced in 2009 or later, plus MacBook (13-inch, Aluminum, Late 2008)introduced in late 2008 or laterintroduced in mid 2007 or laterintroduced in early 2009 or laterintroduced in mid 2007 or laterintroduced in early 2008 or laterXserve models introduced in early 2009To find your Mac model, memory, storage space, and macOS version, choose About This Mac from the Apple menu . You can upgrade to OS X El Capitan from on any of the following Mac models. Fakesmc for el capitan. If your Mac isn't compatible with OS X El Capitan, the installer will let you know.

Obs 24 for mac os release date history. Note: if gcc-4.9 isn't being found, try opening a new shell. The $PATH sources need to be refreshed.

It's probably a bad idea to alias gcc to gcc-4.9 because some programs (Homebrew included) may expect clang. Instead, I suggest using Makefiles to easily specify your compiler.

ALWAYS test your code in the provided VM before submitting! You have been warned.

Using llvm/clang

Git For Github Mac Osx Yosemite Without Xcode Version

Another option is just to use what's included with your system. llvm/clang is a very capable, modern compiler and can, for the most part, compile the exact same code that works in gcc, at least in the scope of COMP 2401.

Caveats

Git Mac Without Xcode

gcc (clang) appears to compile everything as C++ code, so you'll probably get some weird warnings that you otherwise wouldn't have seen. Fortunately, I've found that fixing things for clang tends to keep gcc-4.9 happy.