Clone only .md files from public repo

Are there a way to clone the specific file from the public repo, such as readme.md, without any extras?

I have a few GitHub projects that I want to keep track of, mainly their readme.md. They are a list of recommended software like titled as “Awesome-<insert_software_type>”. I am not familiar with the git process and I am extremely new with it. It seem the way to do this is to clone the public repo with Obsidian Git plugin and it will put anything in that folder. So for example, I want the plugin to download and update the readme.md file if there are update for readme.md like this public repo mundimark/awesome-markdown. When I cloned the public repo, it downloaded the files from public repo (three .md files) without issues. However, it generated additional files inside the folder such as .git folder.

I don’t want the plugin to create .git folder other than config file (I understood why it need config file as it contained the information of the repo). It generated more stuff such as HEAD, description, and various folders. And .git folder for each repo often consume more bytes than the readme.md file which tend to be way less than the .git folder. That means it makes more work for my Android phone and tablet to download those needless additional files and folders, I uses OneSync for OneDrive for my Obsidian vault.

Not a git guru myself but this is what I can see here:

  • Download the readme files individually and put them – wherever: folders or give them tags.
  • Not sure how .gitignore would work because that is probably only good for excluding files on pull and push, not clone.

The clutter you don’t need is prevented by downloading the single files manually.

I figured I would have to manually download the files myself.

I managed to find alternative way by using cURL command. I have the config file to tell cURL to download list of files from the GitHub public repos by linking to raw content of readme.md. Then it renamed each .md files based on the repo owner and repo name, for example “gino_m - awesome-obsidian.md”. And then output it to specific directory path in Obsidian vault.

curl.exe --config awesome.txt --output-dir C:\Users\<username>\OneDrive\Obsidian\Awesome\

It works great for me. It will overwrite those files every time I use the config file, I need to figure out how to use the command for finding file modified time, so it only download the files that are updated. That is another project todo in other time. I am satisfied with I have now.

Thank you for responding!

I optimized my config file by adding output-dir = for each URL in the file. So it is not necessary to have this append --output-dir C:\Users\<username>\OneDrive\Obsidian\Awesome\ in the command line.

Also, I changed the file extension to .md as it is resting in my Obsidian vault. The revised command is now:
curl.exe --config awesome.md

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.