0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
A tool to safely replace your local git repository with a fresh clone from the remote. Clones to a temporary directory first to protect your local copy if something goes wrong, and automatically restores your current branch.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 3.0
~> 1.0

Runtime

>= 1.2, ~> 1.2
 Project Readme

git-reclone 🚀

Gem Version Build Status MIT

replace your local copy of a git repo with a fresh clone from your remote.

Screencast

tested and works well for:

- github
- bitbucket
- gitea
- gogs

setup

[sudo] gem install git-reclone

This will enable the git reclone command automatically!

usage

git reclone

reclones from the first git remote. to clone a specific remote, specify some part (or all) of the host name. for example:

git reclone bit
git reclone bucket
git reclone bitbucket

will all replace the current repository with a fresh clone from bitbucket's remote (assuming that some other host/repo name doesn't also match 'bitbucket').

The tool safely clones to a temporary directory first, so if the clone fails, your local copy remains intact. Your current branch is automatically restored after recloning (if it exists on the remote).

about

sometimes i mess up git histories, with (merges or rebasing, etc), and it becomes more of a headache to figure out how to undo what i did than to just get a fresh clone from the remote and apply the changes i want in the right way. i was doing this often enough that i figured it would be nice to have a tool that just did this automatically. the tool clones to a temporary directory first, so if something goes wrong, your local copy is safe. besides, it can be satisfying to just start fresh from the remote - after all, what are backups meant for?

testing

bundle || gem install bundler && bundle
rake # running git-reclone's tests