Problem
If you encounter an error while trying to close a project on a Mac, you may see an error message like the one below:
Error: Command failed: /usr/local/bin/git push --force https://abcdefg/********@exploratory.io/git/abcdefg/__________55_abcFTH4.git HEAD:master
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
error: RPC failed; HTTP 504
curl 22 The requested URL returned error: 504
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
If this happens, please follow the steps below to resolve the issue.
Solution
Step 1: Check if Homebrew is installed
Open the Terminal app, type the following command, and press Enter:
brew --version
If a version number (e.g., Homebrew 4.x.x) is displayed, Homebrew is already installed. You can proceed to Step 2.
If you see an error message like the one below, you need to install Homebrew. Please follow the “How to install Homebrew” section.
command not found: brew
How to install Homebrew (if necessary)
Copy and paste the following command into your terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The installation will begin. If you see a Password: prompt, enter the password you use to log in to your Mac. Note: For security reasons, the characters will not appear on the screen as you type.
After typing your password, press Enter. Once the installation is complete, you will see a message like Installation successful!.
For Apple Silicon Macs (M1, M2, M3, etc.): Additional configuration is required. Run the following two commands in order:
-
Paste this and press Enter:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile -
Paste this and press Enter:
eval "$(/opt/homebrew/bin/brew shellenv)"
Finally, verify the installation by running:
brew --version
If the version number appears, the installation was successful!
Step 2: Install Git
Once Homebrew is ready, run the following command:
brew install git
You will see messages indicating that Git is being downloaded and installed. This may take a few minutes.
Step 3: Remove the old Git binary
After Git is installed, run the following command:
sudo rm /usr/local/bin/git
If prompted for a Password:, enter your Mac login password and press Enter. Again, no characters will be displayed as you type.
Step 4: Create a link to the new Git
Run the following command to link the newly installed Git:
sudo ln -s /opt/homebrew/Cellar/git/2.46.0/bin/git /usr/local/bin/git
If prompted for your password, enter it and press Enter.
Step 5: Try closing the project again
Return to your application and try closing the project again. The error should now be resolved.
Note: If the problem persists, try installing Xcode from the App Store. Xcode includes its own version of Git, which may also resolve the issue.