diff --git a/news/5518.bugfix b/news/5518.bugfix
new file mode 100644
index 000000000..832098a71
--- /dev/null
+++ b/news/5518.bugfix
@@ -0,0 +1,2 @@
+Respect ``--global-option`` and ``--install-option`` when installing from
+a version control url (e.g. ``git``).
diff --git a/src/pip/_internal/wheel.py b/src/pip/_internal/wheel.py
index 1bdbe93ab..18f25df4a 100644
--- a/src/pip/_internal/wheel.py
+++ b/src/pip/_internal/wheel.py
@@ -763,10 +763,6 @@ def should_use_ephemeral_cache(
     if req.editable or not req.source_dir:
         return None
 
-    if req.link and not req.link.is_artifact:
-        # VCS checkout. Build wheel just for this run.
-        return True
-
     if "binary" not in format_control.get_allowed_formats(
             canonicalize_name(req.name)):
         logger.info(
@@ -775,6 +771,10 @@ def should_use_ephemeral_cache(
         )
         return None
 
+    if req.link and not req.link.is_artifact:
+        # VCS checkout. Build wheel just for this run.
+        return True
+
     link = req.link
     base, ext = link.splitext()
     if cache_available and _contains_egg_info(base):

pip ignores --global-option and --install-options when installing from a VCS url
**Environment**

* pip version: 10.0.1
* Python version: 3.6.5
* OS: Linux

**Description**
pip 10.0.1 ignores --install-options installing from git+git://

Likely related to

https://github.com/pypa/pip/issues/5251

```
$ pip install --ignore-installed --no-deps --install-option="--prefix=/tmp/test-install" git+git://github.com/bccp/nbodykit

$ ls /tmp/test-install
ls: cannot access '/tmp/test-install': No such file or directory
```

However, installing from zip works:

```
$ pip install --ignore-installed --no-deps --install-option="--prefix=/tmp/test-install" http://github.com/bccp/nbodykit/archive/master.zip

$ ls /tmp/test-install
lib

```

**Expected behavior**
installing from VCS shall be no different than from a zip file.

**How to Reproduce**
See above.

**Output**

See above.

diff --git a/tests/unit/test_wheel.py b/tests/unit/test_wheel.py
index 19a3259ed..14cde104b 100644
--- a/tests/unit/test_wheel.py
+++ b/tests/unit/test_wheel.py
@@ -99,6 +99,49 @@ def test_should_use_ephemeral_cache__issue_6197(
     assert ephem_cache is expected
 
 
+@pytest.mark.parametrize(
+    "disallow_binaries, expected",
+    [
+        # By default (i.e. when binaries are allowed), VCS requirements
+        # should be built.
+        (False, True),
+        # Disallowing binaries, however, should cause them not to be built.
+        (True, None),
+    ],
+)
+def test_should_use_ephemeral_cache__disallow_binaries_and_vcs_checkout(
+    disallow_binaries, expected,
+):
+    """
+    Test that disallowing binaries (e.g. from passing --global-option)
+    causes should_use_ephemeral_cache() to return None for VCS checkouts.
+    """
+    req = Requirement('pendulum')
+    # Passing a VCS url causes link.is_artifact to return False.
+    link = Link(url='git+https://git.example.com/pendulum.git')
+    req = InstallRequirement(
+        req=req,
+        comes_from=None,
+        constraint=False,
+        editable=False,
+        link=link,
+        source_dir='/tmp/pip-install-9py5m2z1/pendulum',
+    )
+    assert not req.is_wheel
+    assert not req.link.is_artifact
+
+    format_control = FormatControl()
+    if disallow_binaries:
+        format_control.disallow_binaries()
+
+    # The cache_available value doesn't matter for this test.
+    ephem_cache = wheel.should_use_ephemeral_cache(
+        req, format_control=format_control, autobuilding=True,
+        cache_available=True,
+    )
+    assert ephem_cache is expected
+
+
 def test_format_command_result__INFO(caplog):
     caplog.set_level(logging.INFO)
     actual = wheel.format_command_result(

pip install -e .
parse_log_pytest
pytest
pytest pytest-cov pytest-rerunfailures pytest-timeout pytest-xdist freezegun mock pretend pyyaml setuptools>=39.2.0 scripttest virtualenv wheel
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.0
execnet==2.1.1
filelock==3.18.0
freezegun==1.5.1
iniconfig==1.1.1
mock==5.2.0
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pretend==1.0.9
pytest==8.3.4
pytest-cov==6.0.0
pytest-rerunfailures==15.0
pytest-timeout==2.3.1
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
PyYAML==6.0.2
scripttest==2.0
six==1.17.0
tomli==2.0.1
virtualenv==20.29.3

name: pip
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - distlib==0.3.9
      - execnet==2.1.1
      - filelock==3.18.0
      - freezegun==1.5.1
      - mock==5.2.0
      - pip==19.1.dev0
      - platformdirs==4.3.7
      - pretend==1.0.9
      - pytest-cov==6.0.0
      - pytest-rerunfailures==15.0
      - pytest-timeout==2.3.1
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - scripttest==2.0
      - six==1.17.0
      - virtualenv==20.29.3
prefix: /opt/conda/envs/pip

tests/unit/test_wheel.py::test_should_use_ephemeral_cache__disallow_binaries_and_vcs_checkout[True-None]
tests/unit/test_wheel.py::test_contains_egg_info[pip-18.0-True] tests/unit/test_wheel.py::test_contains_egg_info[foo-2-2-True] tests/unit/test_wheel.py::test_contains_egg_info[im-valid-True] tests/unit/test_wheel.py::test_contains_egg_info[invalid-False] tests/unit/test_wheel.py::test_contains_egg_info[im_invalid-False] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__issue_6197[pendulum-2.0.4-False-False-False] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__issue_6197[pendulum-2.0.4-True-True-False] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__issue_6197[pendulum-2.0.4-True-False-True] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__issue_6197[pendulum-True-True-True] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__issue_6197[pendulum-True-False-True] tests/unit/test_wheel.py::test_should_use_ephemeral_cache__disallow_binaries_and_vcs_checkout[False-True] tests/unit/test_wheel.py::test_format_command_result__INFO tests/unit/test_wheel.py::test_format_command_result__DEBUG[output tests/unit/test_wheel.py::test_format_command_result__empty_output[DEBUG] tests/unit/test_wheel.py::test_format_command_result__empty_output[INFO] tests/unit/test_wheel.py::test_get_legacy_build_wheel_path tests/unit/test_wheel.py::test_get_legacy_build_wheel_path__no_names tests/unit/test_wheel.py::test_get_legacy_build_wheel_path__multiple_names tests/unit/test_wheel.py::test_get_entrypoints[pip tests/unit/test_wheel.py::test_get_entrypoints[pip:pip tests/unit/test_wheel.py::test_sorted_outrows[outrows0-expected0] tests/unit/test_wheel.py::test_sorted_outrows[outrows1-expected1] tests/unit/test_wheel.py::test_get_csv_rows_for_installed tests/unit/test_wheel.py::test_get_csv_rows_for_installed__long_lines tests/unit/test_wheel.py::test_wheel_version tests/unit/test_wheel.py::test_python_tag tests/unit/test_wheel.py::test_check_compatibility tests/unit/test_wheel.py::TestWheelFile::test_std_wheel_pattern tests/unit/test_wheel.py::TestWheelFile::test_wheel_pattern_multi_values tests/unit/test_wheel.py::TestWheelFile::test_wheel_with_build_tag tests/unit/test_wheel.py::TestWheelFile::test_single_digit_version tests/unit/test_wheel.py::TestWheelFile::test_non_pep440_version tests/unit/test_wheel.py::TestWheelFile::test_missing_version_raises tests/unit/test_wheel.py::TestWheelFile::test_invalid_filename_raises tests/unit/test_wheel.py::TestWheelFile::test_supported_single_version tests/unit/test_wheel.py::TestWheelFile::test_supported_multi_version tests/unit/test_wheel.py::TestWheelFile::test_not_supported_version tests/unit/test_wheel.py::TestWheelFile::test_supported_osx_version tests/unit/test_wheel.py::TestWheelFile::test_not_supported_osx_version tests/unit/test_wheel.py::TestWheelFile::test_supported_multiarch_darwin tests/unit/test_wheel.py::TestWheelFile::test_not_supported_multiarch_darwin tests/unit/test_wheel.py::TestWheelFile::test_support_index_min tests/unit/test_wheel.py::TestWheelFile::test_support_index_min_none tests/unit/test_wheel.py::TestWheelFile::test_unpack_wheel_no_flatten tests/unit/test_wheel.py::TestWheelFile::test_purelib_platlib tests/unit/test_wheel.py::TestWheelFile::test_version_underscore_conversion tests/unit/test_wheel.py::TestMoveWheelFiles::test_std_install tests/unit/test_wheel.py::TestMoveWheelFiles::test_install_prefix tests/unit/test_wheel.py::TestMoveWheelFiles::test_dist_info_contains_empty_dir tests/unit/test_wheel.py::TestWheelBuilder::test_skip_building_wheels tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_no_script tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_single_script__single_dir_not_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_two_script__single_dir_not_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_multi_script__multi_dir_not_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_multi_script_all__multi_dir_not_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_two_script__single_dir_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_multi_script__multi_dir_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_multi_script__single_dir_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_single_script__single_dir_on_PATH tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_PATH_check_case_insensitive_on_windows tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_trailing_ossep_removal tests/unit/test_wheel.py::TestMessageAboutScriptsNotOnPATH::test_missing_PATH_env_treated_as_empty_PATH_env
news/5518.bugfix src/pip/_internal/wheel.py
news/5518.bugfix src/pip/_internal/wheel.py