Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Force lfs to overwrite remote

Craig Williams November 3, 2019

I'm getting close to my limit for LFS on Bitbucket. I'd like to delete all of the LFS files stored in the repo, and the use my local copy to reupload the latest version.

I'm aware that I can delete the individual files as per here, but how to I force LFS to push the local branch head without making changes to everything in it?

I've tried using:

git lfs push --all

but that seems to upload the history of everything on LFS, which means that my limit is full again...

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 2019

Hello @Craig Williams,

Thanks for reaching out.

I'm not sure there's a ready to use command / option for this, but something like this should work:

git lfs ls-files -l | awk '{ print $1 }' | xargs git lfs push --object-id origin

 Hope this helps.

Cheers,
Daniil

Craig Williams November 3, 2019

Awesome, exactly what I was looking for. Thanks.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events