Error while pushing the changes after uninstalling git lfs

Viewed 1095

i have a repository enabled with git lfs,

1, when i tried to uninstall git lfs using git lfs uninstall

getting the following WARNING: error running /usr/lib/git-core/git 'config' '--global' '--remove-section' 'filter.lfs': 'fatal: No such section!' 'exit status 128'

2, while pushing the sources to remote facing the following error

! [remote rejected] devbranch -> devbranch (pre-receive hook declined)
error: failed to push some refs to 'http://gitlab.com/froup/repo1.git'

my git config file looks like below

git config --list
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
user.email=ank@gmail.com
user.name=ank
color.ui=auto
core.repositoryformatversion=0
core.filemode=true
filter.lfs.smudge=git-lfs smudge --skip -- %f
filter.lfs.process=git-lfs filter-process --skip
lfs.allowincompletepush=false
1 Answers

For point 1 :

it looks like the uninstaller only tries to remove config parameters from your global git config (~/.gitconfig), but you may have lfs parameters stored in other config files (for example : .git/config, the config file local to that single repository).

Type :

git config --list --show-origin

to have git tell you the source of each parameter.


For point 2 : your push is rejected by the gitlab server.

It is probably linked to :

  1. the content of your commits : since you uninstalled git lfs from your machine, the commits you create on your machine will now contain the complete content of files (instead of : a link created by the git lfs extension)

  2. some rules defined on the server side : perhaps the gitlab server is configured to check that, for example, .img files are committed as lfs links and not like complete binary blobs.

Check the config of the repo on gitlab, or ask an administrator, and if you still need help ask another question about how you can transform your local clone to match the rules of the central repo.
You may have to work from a fresh clone of the repo to avoid breaking the existing content.

Related