Skip to content

Instantly share code, notes, and snippets.

View dchakro's full-sized avatar
👨‍💻

Deepankar Chakroborty dchakro

👨‍💻
View GitHub Profile
@dchakro
dchakro / remove-git-lfs.md
Last active June 10, 2021 09:10 — forked from everttrollip/remove-git-lfs.md
Removing git lfs from (any) repository

So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,

  • git add --update; git commit -m “Commit before lfs removal”; git push
  • git checkout -b “remove-lfs”
  • remove hooks git lfs uninstall
  • remove files enrolled in git-lfs from .gitattributes (open the file, delete the contents) [P.S. don’t delete the file!]
  • list all lfs files, git lfs ls-files
  • run git rm --cached for each file
    • git lfs ls-files | cut -f 3 -d ' ' | xargs git rm --cached
  • Untrack files (individually or pattern)git lfs untrack '*.xz'
@dchakro
dchakro / parallelRDS.R
Last active June 15, 2021 07:27 — forked from retrography/parallelRDS.R
Parallelize RDS compression/decompression to improve serialization performance in R
# Modified from: https://gist.github.com/retrography/359e0cc56d2cf1acd161b5645bc801a8
# The functions below use parallelized version of gzip called pigz
# to improve compression/decompression performance of RDS serialization in R.
# Each function searches for the appropriate program (based on the require
# compression format) and if found, offloads the compression handling to the
# external program and therefore leaves R free to do the data import/export.
# The functions have been only tested on macOS, but probably also work on other *nix systems