Skip to content

Use xcode-select -p as a base path to xcode-git#1

Open
p4checo wants to merge 1 commit into
chrisdanford:masterfrom
p4checo:use-xcode-select-as-base-path-to-xcode-git
Open

Use xcode-select -p as a base path to xcode-git#1
p4checo wants to merge 1 commit into
chrisdanford:masterfrom
p4checo:use-xcode-select-as-base-path-to-xcode-git

Conversation

@p4checo
Copy link
Copy Markdown

@p4checo p4checo commented Sep 12, 2020

The git script assumed it was always run from <Xcode dir>/usr/bin and as such used $(dirname $0) as a base path to point to the original Xcode git binary.

However, that's not always the case as there are other places that symlink to Xcode's /usr/bin/git, like
<Xcode dir>/usr/libexec/git-core/git, meaning that any operation that used these links would fail.

By using the xcode-select -p path as a base path to the Xcode directory this is fixed.

PS: Thanks for making this! 🙌

The `git` script assumed it was always run from `<Xcode dir>/usr/bin`
and as such used `$(dirname $0)` as a base path to point to the original
Xcode git binary.

However, that's not always the case as there are other places that
symlink to Xcode's `/usr/bin/git`, like
`<Xcode dir>/usr/libexec/git-core/git`, meaning that any operation that
used these links would fail.

By using the `xcode-select -p` path as a base path to the Xcode
directory this is fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant