Does Xcode 4 install git? - xcode

I bought a new MacBook Pro and installed the applications list below in order. On my old MacBook, also running OS X 10.6.6, I didn't have /usr/bin/git, however, on the new MacBook Pro, I do. The only differences that I can think of between the two systems are:
New MacBook Pro has Xcode 4 vs. Xcode 3 on old MacBook
New MacBook Pro installed git using homebrew vs. old MacBook installed [git-osx-installer][]
Homebrew installed git 1.7.4.1 into /usr/local/Cellar/git and symlinked it into /usr/local/bin. This leads me to believe that Xcode 4 installed git 1.7.3.4 into /usr/bin. Can anyone confirm or deny this?
If Xcode 4 didn't install git 1.7.3.4 into /usr/bin, any thoughts what program did?
Applications Installed in Order
First boot
Ran Apple's Software Update
Ran Bootcamp to create 48GB NTFS partition for Windows 7
Installed iWork '09 and ran software update to install iWork Update 5
Installed TextExpander 3.2.4
Installed Dropbox 1.0.20
Installed 1Password 3.5.9
Installed Alfred 0.8.2 (107)
Installed Adium 1.4.1
Started installation of Xcode4 via App Store
Installed Caffeine 1.1.1 via App Store
Installed Kindle via App Store
Completed installation of Xcode 4 via App Store
Installed Homebrew using the following command:
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
Installed git using brew install git
Installed MacVim using brew install macvim
Update: Package Receipt Info
I ran pkgutil --file-info /usr/bin/git and the following info was displayed. This appears to incriminate Xcode 4.
volume: /
path: /usr/bin/git
pkgid: com.apple.pkg.GitLeo
pkg-version: 4.0.0.9000000000.1.1248867338
install-time: 1300459157
uid: 0
gid: 0
mode: 755
Why It's a Problem that Xcode 4 Installs git
By default, the path /usr/local/bin is after /usr/bin (see the file /etc/paths). This means that git 1.7.3.4 is used instead of 1.7.4.1 that Homebrew installed.

Yes, it does. I just finished the Xcode 4 install. git was previously installed to /usr/local/git.
I am new to OS X, and can only suggest swapping the order of those directories in /etc/paths.
Not sure what else would/might work.

Under Preferences, Downloads there was an option for Command Line Tools. I installed that and it worked well.

I just looked into this and found git in /Applications/Xcode.app/Contents/Developer/usr/bin after installing Xcode from the App Store on 10.7.4. Adding that directory to my PATH seems to have done the trick.

I had to install the command line tools. Here's a helpful answer https://github.com/mxcl/homebrew/issues/10244#issuecomment-4013781

Xcode 4 installs git at /Developer/usr/bin and at /usr/bin. Xcode 4 uses the version at /Developer/usr/bin. I believe Xcode 4 also invokes git with a full path, so changing the path variable won't change the version of git being used by Xcode 4 itself. Of course, if you are just using git outside of Xcode, none of this matters.

I have been dealing with that same problem. Since I added the new default push style to my git command several programs have been failing because they were still using some internal old version of git.
I think I gave a good temporal solution here:
https://apple.stackexchange.com/a/72524/26545

Related

Install Git on Mac without Xcode

I've been using windows for software development. I'm not aware of MacOS internals.
I'm aware that Xcode software is used to develop iOS/Mac apps but I don't need it.
For my usecase, I was able to install intellij, Java, Docker, Minikube & Visual-Studio-Code on my Intel Mac with BigSur...
I'm able to run simple micro-service with working DB in local in docker container.
But when I try to use Git I'm getting this issue:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I think this is related to Xcode. I didn't want to touch it,
so I tried to install Git by brew.
brew install git but got error
Error: git 2.29.2 is already installed
So I tried to do update
brew upgrade git but again got the below error again.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I also tried to remove Git to do a clean install
brew remove git and there was no error, but then I installed git with brew again and the same error.
Is there a way to install Git without having Xcode ?
I dont want to install unnecessary software on my machine, things which I don't need.
Note that this is a plain copy of a previous answer of mine on superuser.com.
Here's a way to install git on Mac OS X without XCode.
Git's official web site provides an installer : http://git-scm.com/download/mac
After installing git, you also have to add its directory to your path :
echo "PATH=/usr/local/git/bin:\$PATH" >> ~/.bash_profile
source ~/.bash_profile
Adding the directory to the path will prevent Mac OS X from aksing you to install XCode each time you type git in the terminal.
Credits goes to Bobby Allen and to GoZoner's answer on SO.
What you need is not xcode but xcode command line tool which has a small download and running file space compared to xcode of 11GB download space and running space of 31GB
You can download it from apple at https://developer.apple.com/downloads/

How do I properly upgrade SVN on MAC?

I'm starting on a new team who are all on PCs using TortoiseSVN with SVN version 1.9.2. I'm on a Mac OSX (El Capitan) using the Versionsapp. When I check svn --version in terminal i get 1.7.10.
When I try any svn command such as svn update I get
svn: E155021: This client is too old to work with the working copy at
'/Users/dpowell/Desktop/sites/site.org.new' (format 31).
You need to get a newer Subversion client. For more details, see
http://subversion.apache.org/faq.html#working-copy-format-change
I've gone to the site and downloaded the python script but don't know it will do anything to help (i.e. I don't know how to use it). I've also downloaded the 1.9 package and tried installing svn that way.
I'm not sure what path to take to solve this issue
The Python script you downloaded from there was to downgrade your SVN version - you need to upgrade your SVN version. I recommend going the homebrew route - it will save you lots of pain in upgrading / installing OSX packages in the future.
Follow the instructions here: http://brew.sh/
(copy that line into a terminal an press ENTER, then follow the prompts)
Then, when homebrew is installed, so update SVN, just do brew install svn.
In Terminal, type "svn --version" to find out what version you currently have
Go to http://www.wandisco.com/subversion/download#osx and download the latest client for OS X and install it. This will install the new svn into /opt/subversion/bin
Got to your terminal and check your $PATH by typing "echo $PATH". If you don't see /opt/subversion/bin in there, make sure you add it by typing export PATH=/opt/subversion/bin:$PATH. If it DOES exist and appears AFTER /usr/bin, then you may need to remove an older copy of svn that came installed on OS X. To do so, go to /usr/bin and remove all files starting with svn. This isn't an exact science but it should do the trick.
For me export PATH=/opt/subversion/bin:$PATH worked as it was installed in /opt/subversion/bin
Make sure you reload your .profile first by typing
. ./.profile*
Type "svn --version". You should see that you have the newest version installed!
brew upgrade subversion
Others solutions require you to register an Account?? forget them.

Git not working. Installed XCode

Using an iMac running OSX 10.8.5 (Mountain Lion). It's a work computer and can't upgrade to a higher OS version at the moment for various reasons.
I tried installing XCode so that I can use Git but it isn't working.
In terminal I run:
git --version
and get this response:
-bash: git: command not found
What am I doing wrong?
You need to install git separately:
http://burnedpixel.com/blog/setting-up-git-and-github-on-your-mac/
Source control was only introduced into Xcode 4. This however does not mean git is installed onto your system as part of downloading Xcode. It just means that you can use some git features in a Xcode project by pressing the source control button at the top. To install the actual git go here.
I'm don't know why it appears to be so, but it looks like Git still isn't installed on your computer. Another way to check if Git is installed is by using the which git command. If that still doesn't help, install it separately. Download Git for Mac.

Git for Mac fails to launch: "illegal instruction"

...I've looked pretty carefully (I believe), and have been unsuccessful at getting an installation of Git for my Mac.
For various reasons, I'm running 10.6.8 of Mac OS X and will not be changing that anytime soon.
I've already gathered and installed the bundle exposed here:
https://help.github.com/articles/set-up-git
The installation instructions are pretty clear, and it's obvious to me that the package installed. But any attempts to use the git client from the command line result in an "Illegal Instruction" error.
I've sifted pretty carefully through information available here:
http://git-scm.com/book/en/Getting-Started-Installing-Git
There is another bundle that seems to be available. It is called "GitHub for Mac 1.7.5, but it appears to require Mac OS X 10.7 or later.
Has anyone else encountered this difficulty? Must I build from source?
I'm a couple of hours of reading and hacking into this effort? Is there something obvious that I've not considered?
Yes, I've had the same exact problem, and what I did is installed an earlier build from here:
https://code.google.com/p/git-osx-installer/
I'm running 10.6.8 and installed the newest build there, 1.8.4.2
SourceForge only has 1.9.0 and 1.8.5.2
http://sourceforge.net/projects/git-osx-installer/reviews?source=navbar
Someone on the reviews said they had trouble with both and went back to 1.7. I would try that if 1.8.4.2 doesn't work.
I was able to run the config commands without an illegal instruction error, at least.
I had this problem and was able to install a working version using Homebrew.
# first uninstall the broken version
# mount the DMG for the broken version using Finder
# "type" this with the tab key! it saves typing and fixes the version number
cd /Volumes/Git\ 2.0.1\ Snow\ Leopard\ Intel\ Universal/
./uninstall.sh
# make bash forget about the uninstalled binary
hash -r
cd
# now install the working version
# assumes you have Homebrew installed
brew install git
git version
I had this today on Snow Leopard after running the suggested git installer from git-scm. Really horrible. Found that installing Macports using their old Snow Leopard package and then
sudo port install git +svn +doc +bash_completion +gitweb
installs git plus its dependencies and git now works fine; version 1.9.3 installed and working on 10.6.8.
I had the same problem. There are various methods for downloading and installing git - Try macports or homebrew. The thing that finally worked for me was having xcode 3.2.6 installed with the additional command line tools - version 3.2 that comes with the leopard install disk wasn't enough. You can install xcode etc. from the disk and then run software update to upgrade it to 3.2.6.
The latest build for Snow Leopard in the official git-osx-installer repo is Git 2.3.5 currently. You can download it from http://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-snow-leopard.dmg/download using web browser. This installation works for me on OS X 10.6.8.
Or you can check yourself for a newer version: http://sourceforge.net/projects/git-osx-installer/files/
Yes - it seems that it does not support the older OS version (mine was 10.6.8). I upgraded to the newest Mac OS 10.9.4 (the installation will take a while), reinstalled the Git software (note that it will ask for xcode to be installed, which I proceeded), and everything works fine from there. Hope this helps.
Ref : https://help.github.com/articles/does-github-for-mac-run-on-os-x-10-6-snow-leopard
To quote:
Does GitHub for Mac run on OS X 10.6 Snow Leopard?
No, GitHub for Mac requires OS X 10.7 (Lion) or higher.
We made this decision because the app relies on a number of
technologies which are not available in Mac OS X 10.6 or earlier. We
want to provide the best experience possible for the app's users, so
we've made the choice to only support 10.7 and above, and not make
earlier versions available.

cvs for Mac OSX

is there a place I can get just the cvs executable for OSX as a standalone binary?
I don't want to go through the whole rigamarole of having to download XCode just to get cvs, which I don't use, except the source for flickrj is only published via a cvs repository.
Using Homebrew:
brew tap homebrew/dupes # cvs is on the homebrew-dupes repository.
brew install cvs
See also:
https://github.com/Homebrew/homebrew-dupes
https://github.com/Homebrew/homebrew-dupes/pull/201
Edit: I don't have it installed here (unfortunately I'm in a Windows machine) but yes, CVS is actually part of Homebrew core, so no need for the dupes repo, for both macOS and Linux versions of Homebrew. brew install cvs should be enough.
Reference:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/cvs.rb
https://github.com/Homebrew/linuxbrew-core/blob/master/Formula/cvs.rb
[Edit]
All links below dead, and the below instructions only appear to work pre OS X Mavericks.
This answer on apple.stackexchange.com appears to solve the issue using 3rd party package managers.
[/Edit]
Not sure what happened to the other posts:
Version Control with CVS on Mac OSX
Xcode is on the DVD that came with your mac.
Boot into a partition with Mac OS X v10.5 (Leopard) installed.
Insert the Mac OS X v10.5 (Leopard) Install DVD.
Double-click the file XcodeTools.mpkg, located inside the directory Optional
Installs/Xcode Tools.
...
ref Apple Xcode Installation Guide
You could install Fink http://www.finkproject.org/download/index.php?phpLang=en then use Fink to install CVS for you, this would be the easiest way.
Alternatively, you could try a BSD binary from from the CVS project website, that might work. The CVS project is now at nongnu.org/cvs/
I just learned nowadays installing xcode is a breeze.
Start installation of xcode from App Store
Have lunch
Type xcrun cvs at the command prompt and - well - enjoy cvs...
If you have xcode installed, the cvs command-line binary is in /Developer/usr/bin, so putting it your path is:
export PATH=/Developer/usr/bin:$PATH
once Xcode is installed with commandline Utillities
export PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
for newer versions of Xcode.
no moving xcode from place to place! =)

Resources