As of May 31, 2023, we have updated our Code of Conduct.

Hot answers tagged

3845 votes
Accepted

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

Solution Open Terminal, and run the following: xcode-select --install This will pop a dialogue box, Select "Install", and it will download and install the Command Line Tools package and fix ...
The Onin's user avatar
  • 64k
179 votes

How to use the Homebrew installed git on Mac?

Status 2022 All the tricks mentioned here in several answers are not necessary anymore on Intel Macs running macOS Sierra or higher with the latest Homebrew. Forget export PATH="..." and ...
Jpsy's user avatar
  • 2,377
99 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

If you don't want to install nor use Xcode (I don't) you can install only command tools for Xcode (please see Edit) Preconditions: you have AppleID Solution Go to https://developer.apple.com/...
michalczukm's user avatar
  • 3,207
73 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

For macOS High Sierra, just run the same command: xcode-select --install and everything will get back to work. 2019 UPDATE: This is needed for every new macOS version, so it'll work for Catalina as ...
diegoiglesias's user avatar
56 votes
Accepted

.git-completion.bash producing error on macOS Sierra 10.12.6

I ran into the exact same problem. After some digging, I finally figured out what the root problem is. They made some major changes to the git-completion.bash script which requires a new feature in ...
wisbucky's user avatar
  • 4,797
43 votes

git auto-complete for *branches* at the command line?

Run this on terminal: curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash Then, do this: vi ~/.bash_profile Add this lines: if [ ...
Caique Pereira's user avatar
39 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

Here are the steps I needed to go through for Mojave: First xcode-select --reset. Next I needed to upgrade xcode tools to the latest version: sudo softwareupdate -ia --verbose (NB: this runs all ...
Erik Madsen's user avatar
38 votes
Accepted

Git Config Error in Xcode

No, this isn't a virus1. It seems that your name and email address are not set up properly in Git. Go to Xcode Preferences and then Accounts, select the repository, and check the username. You can ...
Mateusz Szlosek's user avatar
37 votes
Accepted

How do I escape the git commit window from OS X terminal?

It looks like you're inside the vi editor. Typing :wq and pressing enter should do it, i.e. save the commit message and exit. : enters the command mode, w is for "write" (save) and q is for "quit". ...
Arthur's user avatar
  • 1,581
35 votes
Accepted

How to uninstall Git from the command shell?

Do not uninstall Apple-distributed Git. You can leave it as it is and run another version by having it in a directory earlier in PATH environment variable. The easiest way to install another version ...
techraf's user avatar
  • 3,898
29 votes

git auto-complete for *branches* at the command line?

git and git-completion.bash already come with macOS command line tools (xcode-select --install). To enable bash autocomplete, add this to your ~/.bash_profile. [ -f /Library/Developer/CommandLineTools/...
Harsh Vakharia's user avatar
27 votes

Git auto-completion not working on Mac OSX 10.11.5 El Capitan

You are confusing the basic bash completion with the add on required for completing git commands. The git that is installed by Apple lacks the required git-completion.bash file so you need to install ...
Tony Williams's user avatar
26 votes

How to use the Homebrew installed git on Mac?

I tried this and it works for me. brew link --overwrite git
Song Wang's user avatar
  • 681
26 votes
Accepted

git is broken: "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo"

OK, I found the problem: the message was coming from the remote git server, not the client side. I ran sudo xcodebuild -license on the server side (where the repo is located and the git server is ...
Rich's user avatar
  • 1,171
26 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

I tried the xcode-select --install but I was forced to install it from the App Store. Then all git stuff ran smoothly.
NoelAbey's user avatar
  • 379
23 votes

git auto-complete for *branches* at the command line?

Git autocompletion on Catalina and newer (using Homebrew) macOs changed from bash to zsh as default shell starting with Catalina. So you will need specific autocomplete scripts for zsh. Here is ...
Jpsy's user avatar
  • 2,377
22 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

xcode-select --install and xcode-select --reset didn't work for me. I had to download it manually from Apple Developers website: https://developer.apple.com/download/ Choose the Command line of your ...
Steffi's user avatar
  • 441
19 votes

How to uninstall Git from the command shell?

For people who installed git by following instructions on the official Git homepage, and therefore have git installed at /usr/local/bin/git, run the uninstall script: /usr/local/git/uninstall.sh
Kasper's user avatar
  • 309
18 votes

Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Ventura?

The accepted answer is correct, but also note that git does not make it obvious if the error is coming from remote or from local. If you are running OS X on your remote, your install problem may be on ...
mirth23's user avatar
  • 281
18 votes
Accepted

Ownership of the .config folder in home directory

The .config folder is supposed to be owned by the user. It appears that the ownership got changed to system by mistake on your machine. To restore the default permission, execute the following ...
Nimesh Neema's user avatar
  • 49.7k
14 votes

Installing git on OSX 10.8 without Xcode

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....
Daishi's user avatar
  • 241
14 votes
Accepted

Broken Git installation on my Mac. How do I fix it?

To debug this, start by executing: type -a git and echo $PATH In OP's case, running the above commands gave the following output respectively: git is /usr/bin/git git is /usr/local/bin/git and /...
Nimesh Neema's user avatar
  • 49.7k
13 votes
Accepted

Homebrew - How to upgrade a HEAD forumla?

It's --fetch-HEAD for upgrade command. Try: brew upgrade libimobiledevice --fetch-HEAD
Yurii Rochniak's user avatar
11 votes

Git auto-completion not working on Mac OSX 10.11.5 El Capitan

As a note for users, like me, who already updated to macOS Catalina, which deprecated bash, yet ended up at this answer as a top result... For macOS Catalina+, which uses zsh, there are a few other ...
NonCreature0714's user avatar
11 votes

How to remove default Git or update it?

sudo rm -rf /usr/bin/git wont work for El Capitan due to SIP restriction simple solution is create alias alias git='/usr/local/bin/git'
Elliot Yap's user avatar
10 votes

How do I escape the git commit window from OS X terminal?

Press Escape Press shift+Z shift+Z (capital Z twice). It works a bit faster.
maxchiu's user avatar
  • 111
10 votes
Accepted

Homebrew installation requests to use my confidential keychain information. Should I allow it to do so?

My answer to question 2 ("Do I have to click 'Allow' for the installation to complete successfully? What will happen if I don't?") is - click "deny" and see what happens. The worst that could happen ...
John N's user avatar
  • 1,448
10 votes
Accepted

Is git pre-installed on macOS Sierra?

macOS does come with a binary at /usr/bin/git, however by default it's a wrapper around the command line tools installer. Running the command will print the following and return immediately. note: ...
grg's user avatar
  • 195k
9 votes
Accepted

ZSH - missing git icons

Turns out I didn't have powerline font. You can get it from here After download, double click to install and set as defalut font & non-ascii font
Błażej's user avatar
  • 339
9 votes
Accepted

How much disk space do the "command line developer tools" take up?

The installer says it requires 2.72 Gb of space. It installs a variety of Unix tools for compiling software, and other advanced usage (such as git) on the command line, including 'many other useful ...
benwiggy's user avatar
  • 30k

Only top scored, non community-wiki answers of a minimum length are eligible