Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to move a repo with git lfs to a new project?

I've got a couple of git repos that have `git lfs` turned on and I'd like to move them to a new project in Bitbucket. However bitbucket is telling me that I cann't move them because of `git lfs` support, why is that and what can I do about it. 


BTW, I'm not really sure that these repos really need `git lfs` support as the files in lfs are only a couple of MB each. 

1 answer

1 accepted

1 vote
Answer accepted
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 04, 2021

Hi, @Matt Schuckmann

Thank you for reaching out to Atlassian Community!

Currently, the transfer of repositories with Git LFS files is disabled, this is a limitation for Git LFS. However, we have a workaround for that:

Instead of transferring the repo, you can clone the repo to your local machine, then create a repo in Bitbucket, and push to that.

When you do this, all files and the Git history will be available in the new repo, but the metadata for such things as issues, pull requests won't be copied over. Furthermore, you'll have to set up users and access permissions for the new repo.

  1. Clone the Git LFS repo to your local machine as usual:

  2. Fetch the Git LFS history:

    git lfs fetch --all origin
  3. Create a new repo in Bitbucket. 

  4. Add a remote locally that points to the new repo:

    git remote add new-origin <URL to new repo>
  5. Now push to the new repo:

    git push -u new-origin --all

    This pushes the repo and its refs for the first time.

  6. Push Git LFS data to the new repo:

    git lfs push --all new-origin
  7. Finally, update the remotes for the new repo:

    git remote set-url origin <URL to new repo>
    git remote set-url --push origin <URL to new repo>

Please let me know how it goes and feel free to share any additional questions or concerns regarding this case. 

Kind regards,
Caroline

Arvid Berndtsson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 11, 2023 • edited

And if you have multiple branches, don't forget to include them when you clone!

Add `--mirror`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events