title: Migrating existing Git repo to new Git LFS enabled repo
body: <p>My existing Github repo is getting bloated with zip and tar.gz files so I want to migrate it to a <strong>new</strong> Git LFS enabled repo that is separate from existing Github repo for testing so that existing Github repo is <strong>untouched</strong>. I came across a wonderful tool called bfg-repo-cleaner <a href="https://github.com/rtyley/bfg-repo-cleaner" rel="nofollow">https://github.com/rtyley/bfg-repo-cleaner</a> and looks like exactly what I need ! </p>
  
  <p>I compiled the steps I think I need to make, but would love a second pair of eyes to make sure these are the correct steps.</p>
  
  <p>Where original existing repo is <code>https://github.com/username/source.git</code> and new destination Git LFS enabled repo is <code>https://github.com/username/destination-lfs.git</code></p>
  
  <pre><code>pass=PERSONAL_ACCESS_TOKEN
  ORIGINAL="https://github.com/username/source.git"
  REPONAME_ORIGINAL='source.git'
  NEW="https://username:"${pass}"@github.com/username/destination-lfs.git"
  REPONAME_NEW='destination-lfs.git'
  
  # setup local work space
  mkdir -p /home/workgit
  cd /home/workgit
  
  # download bfg
  wget -cnv http://repo1.maven.org/maven2/com/madgag/bfg/1.12.12/bfg-1.12.12.jar -O bfg.jar
  alias bfg='/bin/java -jar bfg.jar'
  
  # setup local git
  git clone --mirror "$ORIGINAL" "$REPONAME_NEW"
  cd $REPONAME_NEW
  git count-objects -v
  git remote rename origin upstream
  git remote add origin $NEW
  git remote -v
  cd ../
  
  time bfg --convert-to-git-lfs '*.{zip,gz,rpm,tgz,xz,bz2,rar,7z,pdf,eot,svg,ttf,woff,woff2}' --no-blob-protection $REPONAME_NEW
  
  cd $REPONAME_NEW
  git reflog expire --expire=now --all &amp;&amp; git gc --prune=now --aggressive
  git count-objects -v
  git lfs init
  git push --dry-run -u origin master
  git push -u origin master
  </code></pre>
  
  <p>Did I miss anything ? It seems the push failed too</p>
  
  <pre><code>git push --dry-run -u origin master                                        
  Git LFS: (76 of 43 files) 799.22 MB / 1.43GB                                                                                                                                                                        
  Authorization error: https://github-cloud.s3.amazonaws.com/xxxx/media/*****?actor_id=xxxxxx
  Check that you have proper access to the repository
  error: failed to push some refs to 'https://username:"${pass}"@github.com/username/destination-lfs.git'
  </code></pre>
  
  <p>Also the original github repo also has additional remotes added for gitlab and bitbucket and backup locations. I believe both bitbucket and gitlab support Git LFS like github does ?</p>
  
  <p>Cheers</p>