Skip to content

Git utility to clone a repo from anywhere on the file system to your regular project directory while mirroring the remote path

Notifications You must be signed in to change notification settings

thoroc/git-mirror

Repository files navigation

git-mirror

Deno script to clone a github/gitlab repo to ~/Projects while keeping a tree structure close to the remote url. If the project is already present, then it'll fetch from the remote.

WARNING this was developed on a MacOS, so no guaranty are offered to run on a different OS.

install

  1. Clone the repo to a sensible place (eg: git clone ~/.git-mirror). Alternatively grab the latests release
  2. Add the following alias to your .gitconfig:
[alias] mirror = "!Deno run --allow-run --allow-read --allow-env ~/.git-mirror/git-mirror.ts"

Usage

Call git mirror [email protected]:owner/repo.git will clone to ~/Projects/owner/repo.

Usage: git-mirror <repo> Version: 0.1.10 Description: Clone a Git repository into the ~/Projects directory. Options: -h, --help - Show this help. -V, --version - Show the version number for this program. -r, --root <rootDir> - The root directory. (Default: "/Users/<user>/Projects") -o, --open-vs-code - Open the repository in VS Code. (Default: true) --no-open-vs-code - Do not open the repository in VS Code. --dry-run - Print the command that would be run.

About

Git utility to clone a repo from anywhere on the file system to your regular project directory while mirroring the remote path

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •