Skip to content

cyftec/ghcopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghcopy

npm version license

A CLI tool to copy files and folders from any GitHub repo's subdirectory and paste directly into your current working directory.

Features

  • Copies files and folders from any github repo subdirectory and pastes them in current directory
  • Copies without initializing git in current directory
  • Copies without checking into any branch
  • No git clone, no svn
  • Works with public GitHub repositories

How to Use

Prerequisites

  1. Mac or Linux or WSL on Windows
  2. Terminal
  3. git tool installed on terminal
  4. Node and npm installed on terminal

Installation

npm install -g @cyftec/ghcopy

Basic usage

ghcopy <github-url>

Examples

Copy entire repository:

ghcopy https://github.com/user/repo

Copy a subdirectory (from 'main' branch):

ghcopy https://github.com/user/repo/tree/main/path/to/some/subdirectory

Copy from a different branch:

ghcopy https://github.com/user/repo/tree/feature-x/templates

What it does internally

  1. Converts GitHub URL to codeload.github.com
  2. Downloads the repo ZIP
  3. Extracts only the target directory
  4. Copies all files and folders into the current directory
  5. Removes temporary files

⚠️ Existing files in the current directory may be overwritten.


How to support

This project is open-source and community-driven. Any form of contribution is welcome.

Contributing with code

If you’d like to improve ghcopy:

  1. Fork the repo
  2. Create a branch based on the type of change/commit
git checkout -b commit_type:your-branch-detail
  1. Make changes and commit
  2. Open a Pull Request with a clear description and screenshots if necessary

Check this link for commit_type convention - https://github.com/pvdlg/conventional-commit-types

Good contribution ideas

  • Adding test-cases
  • Better error handling for invalid URLs
  • Support for private repos via token
  • Progress indicators

Contributing financially

If this tool saves you time, consider supporting its development.

Options:

Other Ways to Help

  • Star the repository
  • Report bugs or request features
  • Improve documentation
  • Share with others

License

MIT License

About

A CLI tool to copy a GitHub repo's directory or subdirectory and pastes its files in current directory in your system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors