Git LFS Migrate from GitHub storeage to Dropbox using lfs-folderstore

GitHub charges exorbitant prices for the storage of files on LFS.
50 GB on GitHub costs $5 a month
2000 GB on DropBox costs $9.99 a month
GitHub is charging 20 times more per GB!
Hence join the rebellion! Move your Git LFS files to DropBox and I hope this will force GitHub to lower their prices to a more reasonable level!
Instructions here are for GitHub, but they should work with no/minimal modifications for BitBucket or any other Git repo hosting provider.

Install lfs-folderstore

Get lfs-folderstore binary from:
Add lfs-folderstore to path (e.g. copy to /usr//bin)

Clone the GitHub repo that you want to migrate LFS objects to Dropbox

git clone <url>

Pull all LFS objects from GitHub repo to local repo

git lfs fetch --all origin

Configure GIT to use lfs-folderstore LFS custom transfer agent

Sample Config lines to add to .git/config
[lfs "customtransfer.lfs-folder"]
    path = lfs-folderstore
    args = E:/Dropbox/git-lfs-folderstore/ns-test-data
[lfs]
    standalonetransferagent = lfs-folder
    url = https://localhost
Commands to run to make the above changes to git config
git config --add lfs.customtransfer.lfs-folder.path lfs-folderstore
git config --add lfs.customtransfer.lfs-folder.args "C:/path/to/your/dropbox/folder"
git config --add lfs.standalonetransferagent lfs-folder
git config lfs.url "https://localhost"

Push to Dropbox LFS folder

GIT_TRACE=1 git lfs push origin master --all
Check “C:/path/to/your/dropbox/folder” to verify that lfs-folderstore has copied LFS objects there. (They will be in folders with hexadecimal names like “f5”, “ee”, “1d”, etc.)

Prune local LFS objects

They are not needed because they have been copied to the DropBox folder in the previous step
git lfs prune

Verify that you can check-out past versions of LFS files

For example:
Checkout a commit 10 commits behind HEAD of master:
git checkout HEAD~10
You may check that the files tracked by git-lfs has changed accordingly.
Tip: 
git lfs ls-files
Lets you see which files are tracked by git-lfs.
Reset back to HEAD of master:
git checkout master

Free-up you GitHub LFS storage!

Send Email/Ticket to GitHub and ask for the LFS objects in your repo to be deleted.
Give them the name of your repo. e.g. username/repo-name and make sure it is ONLY LFS objects deleted.

Getting Krusader to work on OSX 10.14 (Mojave)

Krusader is a very useful file management application in the likes of the “legendary” midnight commander.

Since I use my Macbook on OSX a lot, I accepted the challenge to get it to work on OSX 10.14 Mojave.

There are 5 things to do here:

  1. Use Macports to compile krusader (This will fail as you will see below)
  2. Apply patches to Macports downloaded krusader source files and get it to compile it successfully.
  3. At this point, krusader “runs” but crashes at startup, so we now have to enable the dbus daemon on OSX.
  4. Now it runs and but the interface is flickering/blinking making it quiet usable, so we use qtconfig to configure the “Interface -> Default Graphics System” to “Native”
  5. Profit.

Macports 

Install XCode

Use the App Store and install XCode (The version I used is 11.3.1)

Install Macports

https://www.macports.org/install.php

Sync Macports

Run the command below in Terminal to get the latest index of Macports packages:

sudo port -v sync

Get Macports to install krusader. It installs packages and downloads source code for compilation.

sudo port install krusader

As mentioned earlier, it will fail to install due to a compilation error. Macports will print a vague message telling you that you want to take a look at a .log file to see what happened. Open the .log file (using your favorite text editor – I use Sublime, but TextEdit that comes with OSX will work), scroll down to near the end and notice the filenames that gave an error during compilation.

Patch Krusader Source Files

Download Patch Files

This is the ticket that has the fix to krusader not compiling on OSX 10.13 – https://trac.macports.org/ticket/58459

Below that page, you will find a link to the patches that we need: https://svnweb.freebsd.org/ports?view=revision&revision=478438

We want to download those 4 patches. Click on each of them and near the top of the page, right-click on Download and save the files to your computer

Patching

If you look at the first patch file, you will find a line like this at the top:

--- krusader/Dialogs/packgui.cpp.orig   2018-08-30 09:48:14 UTC

Remember the filename you got while looking at the Macports install log file? We now want to use Terminal and navigate to the parent of the parent folder of the file.

For example, if the filename path is: /some/long/path/krusader/Dialogs/packgui.cpp.orig, we want to be in the folder: /some/long/path

Move the patch files you downloaded to the folder mentioned above, 

Now run the following for each of the 4 patch files:

patch -p0 the_name_of_patch_file_you_downloaded

The above command should say something along the line that the patch was successfully applied.

Get Macports to compile Krusader again

Run:

sudo port install krusader

Congrats, it should go ahead and complete compilation of Krusader and install it as /Applications/MacPort/KDE4/krusader.app

Enable dbus Daemon

In Terminal, run:

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

If you run Krusader, it should run now, however, you might notice the interface blinking erratically. The fix is found below.

Configure QT/KDE Default Graphics System

Run qtconfig – Double-click qtconfig found in /Applications/MacPorts/Qt4

Navigate to the Interface tab and select OpenGL for the Default Graphics System (found below the tab page). Close the app and click on Save when it asks you if you want to.

Double click in Finder: /Applications/MacPorts/KDE4/krusader.app

Voila! Krusader runs in OSX 10.14 as advertised. Enjoy and stay safe.