1

I want to migrate Git repository to new server. But new server has restriction that blocks user from uploading binary files. The old repository contains some jar files. I am ok if these jar files wont uploaded to new git repository. I am using below command:

git push --mirror new_repo_url

How I can migrate this?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Ajay Nikam
  • 279
  • 5
  • 18

2 Answers2

0

You might need to checkout the repo locally, then add a .gitignore file that excludes *.jar and any other binary files that are not allowed. Check that change in locally and then try to push to the new server.

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44
  • Hi Adrian, unfortunately this is not working. There are multiple branches. I tried adding git ignore(*.jar) in all the branches but did not work. I need migration because we need history of previous check-ins – Ajay Nikam Sep 18 '20 at 12:56
0

You need to first clean the binaries out of your history in a local copy of your git repository.

  1. Clone a bare repository locally, git clone --bare <URL>
  2. Use BFG Repo-Cleaner to make a clean copy of the repository ignoring the JAR files
  3. Clone your clean repository locally to check the results
  4. Push the clean repository to the new host
Rob Prouse
  • 22,161
  • 4
  • 69
  • 89