DEV Community

Arjun Adhikari
Arjun Adhikari

Posted on • Edited on

2 3

Download required folder only from GitHub with Subversion

Hello pals,
We all have experienced a situation where we need to download a folder from GitHub but we are forced to clone a whole bulky repository and then access the required folder. Well, no more reason to fear to worry of these situations. Through this blog tutorial I'm going to guide you to download only the required folder from GitHub without cloning the whole repository.

Navigate the repository and directory you want

First of all, navigate to the repository you want to access the folder. Here, I am taking my Machine Learning repository as example.

ML Repo

Then, I am navigating to the directory named data-visualization which I want to download. Then copy the URL from the browser address bar which is https://github.com/theArjun/machine-learning/tree/master/data-visualization in my case. Note this or get it stored in clipboard.

Data Visualization Repo

Install Subversion

I am using subversion to download the required directory. For doing so, make sure you've installed it on your system.

apt-get install subversion
Enter fullscreen mode Exit fullscreen mode

Tweak URL

I hope you've noted the directory URL from GitHub or get it stored on clipboard which was https://github.com/theArjun/machine-learning/tree/master/data-visualization in my case.
Now replace the tree/master with trunk which results to https://github.com/theArjun/machine-learning/trunk/data-visualization and note it again. Good going pals, we're now at the final stage.

Download the Directory

Open the terminal and execute the following command :

svn checkout https://github.com/theArjun/machine-learning/trunk/data-visualization
Enter fullscreen mode Exit fullscreen mode

The URL was the tweaked URL which I guided in Tweak URL section. The execution of command looks like following in terminal.

$ svn checkout https://github.com/theArjun/machine-learning/trunk/data-visualization

A    data-visualization/Data Generation - Classification.ipynb
A    data-visualization/Data Generation - Regression Data.ipynb
A    data-visualization/Data Normalization and Standardization.ipynb
A    data-visualization/Data Visualization - Subplots.ipynb
A    data-visualization/Exploring Sklearn Datasets.ipynb
A    data-visualization/Generating Data using Sk-Learn.ipynb
A    data-visualization/Matplotlib Basics.ipynb
A    data-visualization/Multivariate Normal Distribution  .ipynb
A    data-visualization/Normal Distribution & Histogram.ipynb
A    data-visualization/Numeric Spacing.ipynb
A    data-visualization/PyCharts, BarCharts and Legends.ipynb
A    data-visualization/Template.ipynb
A    data-visualization/Working with Pandas - MNIST Dataset.ipynb
A    data-visualization/Working with Pandas.ipynb
A    data-visualization/csv
A    data-visualization/csv/linearX.csv
A    data-visualization/csv/linearY.csv
A    data-visualization/csv/movie_data.csv
Checked out revision 103.
Enter fullscreen mode Exit fullscreen mode

and a directory named data-visualization gets created on the working folder.

$ ls

data-visualization
Enter fullscreen mode Exit fullscreen mode

This folder contains all the files which are on the data-visualization folder on the GitHub i.e. totally synced with the remote (GitHub).

So, no worries, create as many folders you need and download them as required without cloning whole bulky repository.
I hope you enjoyed learning a new trick. I will be back with similar tricks soon. Till then keep coding :).

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (1)

Collapse
 
shalujha profile image
shalujha

It was really helpful.. waiting for ur next blog!!🔥🔥

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay