Skip to content

Commit

Permalink
add lfs recommendations to git troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
Brilator committed Jul 22, 2024
1 parent b4a7cfa commit 087d5ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/docs/_sidebars/mainSidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Continuous Quality Control (CQC) p
### [Publication to ARC](/docs/guides/publicationToARC.html)

## [Troubleshooting](/docs/guides/index-Troubleshooting.html)
### [Git Troubleshooting](/docs/guides/git-troubleshooting.html)
### [Git Troubleshooting & Tips](/docs/guides/git-troubleshooting.html)

## [Contribute](/docs/guides/index-Contribute.html)
### [Swate Templates](/docs/guides/swate_template-contribution.html)
Expand All @@ -150,7 +150,6 @@ Continuous Quality Control (CQC) p
### [July: Data Steward Circle](/docs/teaching-materials/events-2023/DataSteward-Circle/index.html)
### [May: CEPLAS Start Your ARC Series](/docs/teaching-materials/events-2023/2023-05-09_CEPLAS-StartYourARC-Series/index.html)
#### [Start Your ARC Series - Videos](/docs/teaching-materials/events-2023/2023-05-09_CEPLAS-StartYourARC-Series/StartYourARC-Videos.html)
C:\Users\david\source\repos\nfdi4plants.knowledgebase\src\docs\teaching-materials\events-2024\2024-02-13-TRR175-Becoming-FAIR\index.md
## [Events 2024](/docs/teaching-materials/events-2024/index.html)
### [TRR175 Becoming FAIR](/docs/teaching-materials/events-2024/2024-02-13-TRR175-Becoming-FAIR/index.html)
### [CEPLAS ARC Trainings – Spring 2024](/docs/teaching-materials/events-2024/2024-04-03_CEPLAS-ARC-Trainings/index.html)
Expand Down
37 changes: 32 additions & 5 deletions src/docs/guides/git-troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: docs
title: Git troubleshooting
date: 2024-01-30
title: Git Troubleshooting & Tips
date: 2024-07-22
author:
- name: Dominik Brilhaus
github: https://github.com/brilator
Expand All @@ -22,8 +22,6 @@ add sidebar: _sidebars/mainSidebar.md
</a>
</div>



## Background

Some reasons, why we now sometimes run into git issues
Expand Down Expand Up @@ -308,7 +306,7 @@ git config --global --add safe.directory *

### Git LFS

[Git LFS](./arc_WorkingWithLargeDataFiles.html) is basically the system in the back to simplify working with (ARCs containing) large data files.
[Git LFS](./arc_WorkingWithLargeDataFiles.html) is basically the system in the back to simplify working with git and (ARCs containing) large data files.
ARC commander and ARCitect offer options to download (clone) an ARC without large files; speeding up the process and avoiding waste of data storage, if you are only interested e.g. in the metadata.

If you have downloaded (cloned) an ARC without large files and try to upload it to a new location (i.e. new remote due to a transfer to other user, group, etc.), you will see the following or similar error
Expand All @@ -320,6 +318,26 @@ error: failed to push some refs to 'https://git.nfdi4plants.org/UserName/ARCName

In this case you would have to download all LFS objects from the original remote first -> ask a data steward for help.

#### Step-by-step track large file(s) via lfs

Done in small steps plus capturing log

```bash
git lfs track "assays/RNAseq_RawData/dataset/**" ## Track files via LFS (this adds them to .gitattributes)
git add .gitattributes ## git track .gitattributes first
git add assays/RNAseq_RawData/dataset/* ## git track the large files

GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1 git commit -m "add rnaseq files to LFS" -v >> git-commit-LFS.log 2>&1 &
GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1 git push -v >> git-push-LFS.log 2>&1 &
```

#### Check the status of lfs files


```bash
git lfs status
```

#### List LFS-tracked files

To get a list of LFS-tracked files including the size of the original file, run
Expand All @@ -342,3 +360,12 @@ git lfs ls-files -d
```

Amongst others, this report will print for every LFS file, whether it is downloaded (`checkout: true; download: true`) to the local ARC or not (`checkout: false; download: false`).


### Get more log

To help troubleshooting add (some or all) variables `GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1` before your git command to get more info, e.g.

```bash
GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1 git push -v >> git-push-LFS.log 2>&1 &
```

0 comments on commit 087d5ce

Please sign in to comment.