-
Notifications
You must be signed in to change notification settings - Fork 2k
Troubleshooting
brian m. carlson edited this page Apr 29, 2020
·
5 revisions
Sometimes things don't go exactly right. Here are some tips for basic troubleshooting:
- First, try running with the environment variable
GIT_TRACE
set to 1 (e.g.GIT_TRACE=1 git push origin master
). This can often show what's going on under the hood. - Check that the remote place you're pushing to or pulling from is actually running a Git LFS server. Git upstream doesn't provide one, so see the Implementations page if you need to find one.
- With the
GIT_TRACE
output, try to determine if the problem is on the client side (with thegit lfs
command itself) or on the server side. - If the error message you're receiving says
batch response
orremote
, that message comes from the server. See the server-side troubleshooting below.
- Check that you've run
git lfs install
orgit lfs install --skip-repo
to set up your Git configuration to use Git LFS. Without this step, Git LFS won't work. There isn't a way to do this automatically for users without changing the system-wide configuration file (usually/etc/gitconfig
). - If you get a message that says
'lfs' is not a git command
, see the Installation page for steps on how to make sure it's installed properly. - Check that the output of running
git lfs env
produces what you think it should produce. Thegit config
entries at the bottom should contain non-empty values; if they are empty, rungit lfs install
. Similarly, the endpoint URLs should point to the server you think they should, and the entries starting with Access should reflect the type of authentication you're using (basic
, for most username-and-password or token authentication).
- If you're adding a new pattern with
git lfs track
and it doesn't seem to be effective, try runninggit check-attr filter FILENAME
to make sure thefilter
attribute is set tolfs
. If it's not, adjust your.gitattributes
file so that the patterns match your file. - In a
.gitattributes
file, Git does not treat directories as matching the directory and everything underneath it; instead, they match nothing. If you want to match a directoryfoo
and all its contents, use the patternfoo/**
. - If you see an error message that says “Authentication required” (and any additional text), that message means your credentials are potentially bad. To clear them, try running
echo "url=$(git remote get-url origin)" | git credential erase
(assuming your remote isorigin
). You will be prompted for new credentials next time you push. Note that this may not work if you're using Git Credential Manager for Windows; see this issue for more details.
- If you're seeing a message that Git LFS is disabled, check to see if Git LFS is enabled for your repository on the server side. Some server implementations require that the repository be specifically enabled for Git LFS.
- If you're using GitHub for hosting and you see a message that Git LFS is disabled or that you're over quota (or another server-side issue), please see the documentation for GitHub (look for "large file") or open a support ticket to get help with your account.