Skip to content

Git 2.21.0 Git LFS not working on a clean Windows Server 2019 installation #2140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
christianbumann opened this issue Mar 26, 2019 · 5 comments
Milestone

Comments

@christianbumann
Copy link

christianbumann commented Mar 26, 2019

  • [ x] 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?

64-Bit

$ git --version --build-options

git version 2.21.0.windows.1
cpu: x86_64
built from commit: 2481c4cbe949856f270a3ee80c802f5dd89381aa
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

OS Name:                   Microsoft Windows Server 2019 Standard
OS Version:                10.0.17763 N/A Build 17763
Original Install Date:     3/26/2019, 7:24:51 AM
System Manufacturer:       Microsoft Corporation
System Model:              Virtual Machine
System Type:               x64-based PC
  • 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

Editor Option: VIM
Custom Editor Path: 
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** A fresh installed Windows 2019 **

Details

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

** CMD or Bash **

**C:\repo>git version
git version 2.21.0.windows.1

C:\repo>git lfs --version
git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)

C:\repo>git lfs checkout
Cannot checkout LFS objects, Git LFS is not installed.

C:\repo>git lfs install
Updated git hooks.
Git LFS initialized.

C:\repo>git lfs checkout

Now the command will run succesfull**

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

** Git should checkout the LFS files **

  • What actually happened instead?

** Message Cannot checkout LFS objects, Git LFS is not installed. appears **

  • Remarks

** After running git lfs install you can uninstall and install Git again, the issue will not be present anymore. That means you need a fresh Windows installation. I only tested it with Windows Server 2019, Windows Server 2012 R2 so I don't know its even an issue with other Windows versions (10, Server 2016). Installing Git 2.20.1 is working on a fresh installation **

@christianbumann christianbumann changed the title Git 2.21.0 Git LFS not registered on a clean Windows Server 2019 installation Git 2.21.0 Git LFS not working on a clean Windows Server 2019 installation Mar 26, 2019
@dscho
Copy link
Member

dscho commented Apr 12, 2019

Hmm. I think we try to imitate that by setting some config entries:

[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true

Maybe newer Git LFS versions do more? Can you dig deeper?

@rimrul
Copy link
Member

rimrul commented Apr 12, 2019

Could we just add git lfs install to the post-install to fix this?

Technically the git lfs documentation says

On all operating systems, once git-lfs is installed, git lfs install must be run. Each user that intends to use git lfs must run this command, but they only ever need to run it once. git-lfs can be disabled by running git lfs uninstall, in which case that user would have to run git lfs install again, before git-lfs features work again.

Some users may wish to only enable git-lfs on specific repositories instead of always having it on for all of the repositories. Instead of running git lfs install and enabling git-lfs for that entire user, git lfs install --local can be used instead on a per repository basis.

and

Windows

  1. Download the windows installer from here
  2. Run the windows installer
  3. Start a command prompt/or git for windows prompt and run git lfs install

So I'd say this behaviour is exactly as intended by the git lfs creators.

Source: https://github.com/git-lfs/git-lfs/wiki/Installation

@rimrul
Copy link
Member

rimrul commented Apr 12, 2019

It seems like they currently set the following values:

[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge --skip -- %f
	process = git-lfs filter-process --skip
	required = true

if I read the source right.

@dscho
Copy link
Member

dscho commented Apr 15, 2019

So I'd say this behaviour is exactly as intended by the git lfs creators.

Yes, but we have to install this into the system config, and in the portable Git, we want to pre-configure it. So I think we'll simply have to add the --skip option to our Git config (https://github.com/git-for-windows/build-extra/blob/master/mingw-w64-git-lfs/git-lfs.install).

@dscho
Copy link
Member

dscho commented May 25, 2019

Turns out that it is not a stale set of filter.lfs config settings that is the problem, but that we do not configure any filter.lfs config settings by mistake!

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

No branches or pull requests

3 participants