progit2 icon indicating copy to clipboard operation
progit2 copied to clipboard

"First-Time Git Setup" docs about .gitconfig are incorrect as of Git For Windows v2.24

Open Gollum999 opened this issue 3 years ago β€’ 3 comments

There's no existing/similar bug report.

  • [X] I have searched the existing issues

This report is about a single actionable bug.

  • [X] I'm reporting a single actionable bug

This report is about the ProGit book, version 2, English language.

  • [X] This bug is not about a translation or old version

Bug covers book website/pdf

  • [X] I confirm the bug is about the book as found on the website/pdf

Problem is present in the Pro Git book on the website?

  • [X] This bug also affects the Pro Git book as published on the website.

Which version of the book is affected?

Source files

Describe the bug:

On this page, there is the following paragraph (emphasis mine):

On Windows systems, Git looks for the .gitconfig file in the $HOME directory (C:\Users\$USER for most people). It also still looks for [path]/etc/gitconfig, although it’s relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer. If you are using version 2.x or later of Git for Windows, there is also a system-level config file at C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, and in C:\ProgramData\Git\config on Windows Vista and newer. This config file can only be changed by git config -f <file> as an admin.

As of git-for-windows/git#2358, this is incorrect. As described in the release notes:

Note! As a consequence of making git config --system work as expected, the location of the system config is now C:\Program Files\Git\etc\gitconfig (no longer split between C:\Program Files\Git\mingw64\etc\gitconfig and C:\ProgramData\Git\config), and likewise the location of the system gitattributes is now C:\Program Files\Git\etc\gitattributes (no longer C:\Program Files\Git\mingw64\etc\gitattributes). Any manual modifications to C:\ProgramData\Git\config need to be ported manually.

Steps to reproduce:

  1. Go to https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
  2. Read text :)

Expected behavior:

I think we could change this to say something like:

On Windows systems, Git looks for the global .gitconfig file in the %USERPROFILE% directory (C:\Users\%USERNAME% for most people). It also looks for the system config file at [path]/etc/gitconfig, where [path] is wherever Git was installed on your system. If you are using Git for Windows version between v2.0.0 and v2.23.0, there is also a secondary system-level config file at %PROGRAMDATA%\Git\config (C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, or C:\ProgramData\Git\config on Windows Vista and newer). This config file can only be changed by git config -f <file> as an admin.

Or we could simply ignore versions of GFW that are 2+ years old:

On Windows systems, Git looks for the global .gitconfig file in the %USERPROFILE% directory (C:\Users\%USERNAME% for most people). It also looks for the system config file at [path]/etc/gitconfig, where [path] is wherever Git was installed on your system.

Screenshots:

No response

Additional context:

No response

Device

No response

Operating system

No response

Browser/application + version

No response

Gollum999 avatar Dec 01 '21 16:12 Gollum999

Or we could simply ignore versions of GFW that are 2+ years old:

On Windows systems, Git looks for the global .gitconfig file in the %USERPROFILE% directory (C:\Users\%USERNAME% for most people). It also looks for the system config file at [path]/etc/gitconfig, where [path] is wherever Git was installed on your system.

I'd say ignore the really old stuff. πŸ˜‰ People should not be using a version of Git for Windows that old anyway. πŸ‘»

What do you think @ben?

HonkingGoose avatar Dec 02 '21 10:12 HonkingGoose

That sounds right to me.

On Thu, Dec 2, 2021 at 2:02 AM HonkingGoose @.***> wrote:

Or we could simply ignore versions of GFW that are 2+ years old:

On Windows systems, Git looks for the global .gitconfig file in the %USERPROFILE% directory (C:\Users%USERNAME% for most people). It also looks for the system config file at [path]/etc/gitconfig, where [path] is wherever Git was installed on your system.

I'd say ignore the really old stuff. πŸ˜‰ People should not be using a version of Git for Windows that old anyway. πŸ‘»

What do you think @ben https://github.com/ben?

β€” You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/progit/progit2/issues/1717#issuecomment-984474486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJXXT2JHWD4MNXOJ2DUPDUO4737ANCNFSM5JE5IYBA .

--

– Ben

ben avatar Dec 02 '21 15:12 ben

Developer webinar

Aarojas3012a avatar Dec 21 '21 02:12 Aarojas3012a

2023-10-27 So I tried following Chapter 1 of the current version, and followed along trying to use the latest information to get set up, and I have to say that something is missing. I have no clue how to use GIT, and this didn't help me get set up using GIT for Windows and trying to connect to my GIT account. Please consider getting someone who doesn't know GIT to use your instructions without your help, then fix them so that people who are new to all this can actually figure it out.

BTW, I'm on 2.42.0.Windows.2

Sturmey66 avatar Oct 27 '23 20:10 Sturmey66