Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Git LFS push results in "batch request: Unauthorized: exit status 1"

Kostya Sydoruk December 14, 2022

Greetings,

I've forked one of my repositories and I now want fork it's LFS as well.

Following this guide:

https://support.atlassian.com/bitbucket-cloud/docs/current-limitations-for-git-lfs-with-bitbucket/#CurrentlimitationsforGitLFSwithBitbucket-fork

I've got to the point of

git lfs push --all origin

 And I got 

batch request: Unauthorized: exit status 1

I've tried adding an SSH key, I've made sure that I have read, write and even admin permissions. all to no avail.
Steps to reproduce:

Create a repo, install LFS, track a file using LFS, Fork the repo and follow above guide.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 15, 2022

Hello @Kostya Sydoruk ,

Welcome to Atlassian Community!

I tried to reproduce the error you reported and the LFS push was completed successfully, so let me share the steps I've followed with you : 

1. Clone the main repository in my local 

2. Fetch all LFS history

git lfs fetch --all origin

At this point, your local clone should have all the LFS files downloaded

3. Inside the local clone, add a remote that points to the forked repository : 

If using SSH :

git remote add fork-origin git@bitbucket.org:<fork's workspace>/<fork repository>.git

Make sure the SSH key being used is associated with a user that has write access to the forked repository.

If using HTTPS

git remote add fork-origin https://BITBUCKET_USERNAME@bitbucket.org/<fork's workspace>/<fork repo>.git

When using HTTPS, if asked for a password, make sure to provide an App Password with the required permissions. If you are still getting an Unauthorized error, you can create an App Password with all permissions checked and try again.

4. Push the LFS files to the forked repo using the origin you set in Step 3 : 

git lfs push --all fork-origin

You can try following the steps above and let us know how it goes.

Thank you, @Kostya Sydoruk .

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events