Skip to content

safe.directory setting issue #3787

@DoveBoy

Description

@DoveBoy
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.35.2.windows.1
cpu: x86_64
built from commit: 518ccba2352ce721cabbbf2933869c3c3313d1c3
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [版本 10.0.22000.593]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

scoop install git
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** insert your response here **

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

PowerShell7

git pull
  • What did you expect to occur after running these commands?

The process of git pull working properly

  • What actually happened instead?
fatal: unsafe repository ('E:\Program Files\Scoop\apps\scoop\current' is owned by someone else) To add an exception for this directory, call:

        git config --global --add safe.directory E:\Program Files\Scoop\apps\scoop\current

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

** insert URL here **

The original repo cannot be manipulated by any git related command, and must be forced to set git config --global --add safe.directory for each repo in order to work, as we currently know from the 2.35.2 update in order to fix a security issue. How to set global trust for all repo in .gitconfig, instead of having to set it for each repo individually, because there are too many repo's and it's too tedious to set each one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions