DEV Community

Discussion on: 10 Git Tricks to Save Your Time and Sanity

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Emergency servival kit: ohshitgit.com/

Collapse
 
jacobherrington profile image
Jacob Herrington (he/him)

That's awesome.

Always an option:

cd ..
sudo rm -r fucking-git-repo-dir
git clone https://some.github.url/fucking-git-repo-dir.git
cd fucking-git-repo-dir
Collapse
 
christhekeele profile image
Christopher Keele

Or just:

rm -rf .git
git init .
git remote add origin https://some.github.url/fucking-git-repo-dir.git
git fetch

To avoid moving out of the directory, overwriting it, or losing changes