Skip to content
Snippets Groups Projects
Commit a43c7139 authored by Johannes Keyser's avatar Johannes Keyser
Browse files

Show that embedding LFS files works the same as usual.

parent b835eb01
No related branches found
No related tags found
No related merge requests found
...@@ -9,9 +9,8 @@ The example consists of ...@@ -9,9 +9,8 @@ The example consists of
- which relies on binary data ([example_data.hdf](example_data.hdf)) stored by Git LFS, - which relies on binary data ([example_data.hdf](example_data.hdf)) stored by Git LFS,
- and stores figure data (as `.png` files) in the folder [plots](plots), stored by Git LFS. - and stores figure data (as `.png` files) in the folder [plots](plots), stored by Git LFS.
The analysis script is stored as a normal Git snapshot (without LFS). The analysis script and this README file are versioned in normal Git snapshots (without LFS).
Note the small badge "LFS" at the files stored in LFS in GitLab's file overview. In GitLab's file overview, the small "LFS" badge next to the file names visualizes which files are stored in LFS.
If you cloned the repository on your machine (and you have LFS installed), you type `$ git lfs ls-files` to get an overview of which files are stored in Git LFS. If you cloned the repository on your machine (and you have LFS installed), you type `$ git lfs ls-files` to get an overview of which files are stored in Git LFS.
In this example, you would see something like this: In this example, you would see something like this:
``` ```
...@@ -23,6 +22,13 @@ f4aa57ea83 * example/plots/plot_example_histogram.png ...@@ -23,6 +22,13 @@ f4aa57ea83 * example/plots/plot_example_histogram.png
82065f2929 * example/plots/plot_example_trace.png 82065f2929 * example/plots/plot_example_trace.png
``` ```
As a nice touch, you can even link and embed files in LFS just as if they were in the repository itself.
For example, to embed one of the plots, use `![](plots/plot_example_trace.png)`:
![](plots/plot_example_trace.png)
## How to reproduce this setup?
To achieve tracking with LFS of these files types (PNG and HDF), irrespective of their path in the repository, you can use these two commands: To achieve tracking with LFS of these files types (PNG and HDF), irrespective of their path in the repository, you can use these two commands:
```sh ```sh
...@@ -37,7 +43,6 @@ This should result in a Git configuration file `.gitattributes` that contains th ...@@ -37,7 +43,6 @@ This should result in a Git configuration file `.gitattributes` that contains th
*.png filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text
``` ```
## Appendix information ## Appendix information
- For the sake of readibility in the browser, the analysis script is a [Jupyter notebook](https://jupyter.org/). - For the sake of readibility in the browser, the analysis script is a [Jupyter notebook](https://jupyter.org/).
- The data are stored in the open data file format [HDF-5](https://www.hdfgroup.org/). - The data are stored in the open data file format [HDF-5](https://www.hdfgroup.org/).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment