¿Cómo eliminar completamente un repositorio git creado con init?
He creado un repositorio git con git init
. Me gustaría eliminarlo por completo e iniciar uno nuevo.
18 answers
Git mantiene todos sus archivos en el directorio .git
. Solo quita esa y vuelve a iniciarla.
Si no puedes encontrarlo, es porque está oculto.
En Windows 7, debe ir a su carpeta, haga clic en Organizar en la parte superior izquierda, luego haga clic en la carpeta y las opciones de búsqueda, luego haga clic en la pestaña Ver y haga clic en el botón de radio Mostrar archivos ocultos, carpetas y unidades.
-
En un Mac OS:
Abra un Terminal (a través de Spotlight: presione CMD + SPACE, escriba
terminal
y presione Enter) y haga este comando:defaults write com.apple.finder AppleShowAllFiles 1 && killall Finder
.O también puedes escribir
cd
(el espacio es importante), arrastrar y soltar tu carpeta git repo desde Finder a la ventana de terminal, presionar return, luego escribirrm -fr .git
, luego return de nuevo.
En Ubuntu, use atajo Ctrl + H .
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-02 15:00:14
Si realmente desea eliminar todo el repositorio, dejando solo el directorio de trabajo, entonces debería ser tan simple como esto.
rm -rf .git
Se aplican las condiciones habituales sobre rm -rf
. Asegúrese de tener una copia de seguridad actualizada y esté absolutamente seguro de que está en el lugar correcto antes de ejecutar el comando. sucesivamente., sucesivamente.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-07-31 16:08:52
Si desea eliminar todo .las carpetas de git en un proyecto usan el siguiente comando:
find . -type f | grep -i "\.git" | xargs rm
Esto también eliminará todos los .git carpetas y .gitignore archivos de todas las subcarpetas
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-06 15:15:21
Alternativa a matar a TortoiseGit:
- Abra TortoiseGit-Settings (haga clic derecho en cualquier carpeta, TortoiseGit → Settings)
- Vaya a la opción Iconos Superpuestos.
- Cambie la Caché de estado de Predeterminada a Ninguna
- Ahora puede eliminar el directorio (ya sea con el explorador de Windows o
rmdir /S /Q
) - la Estado de la Caché de None a Default y usted debería estar bien nuevo...
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-10 18:50:56
Cd al directorio desde el que git necesita ser eliminado y ejecutar command
Mac OS o cualquier distribución de Linux
rm -rf .git
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-01-13 16:57:56
Donde $GIT_DIR es la ruta a la carpeta a buscar (la ruta de repositorio de git), ejecute lo siguiente en terminal.
find $GIT_DIR -name *.git* -ok rm -Rf {} \;
Esto buscará recursivamente cualquier directorio o archivo que contenga ".git " en el nombre del archivo / directorio dentro del directorio Git especificado. Esto incluirá .git / and .archivos gitignore y cualquier otro .activos similares a git. El comando es interactivo y preguntará antes de quitar. Para continuar con la eliminación, simplemente ingrese y, luego Ingrese.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-14 17:06:55
Puede usar el siguiente comando desde la línea de comandos-
rm -rf .git
Aquí rm
significa eliminar, -rf
significa fuerza recursiva y .git
es el archivo/repo que desea eliminar. Tenga cuidado al usar este comando. Si ha intentado rm -rf
cualquier otro archivo o carpeta, pueden ser eliminados permanentemente. Nunca ejecute esto en su escritorio. Puedes borrar todo tu trabajo. Tenga cuidado al usar este comando.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-11 05:44:36
Ejecutar
rm -rf .git
En tu carpeta repo
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-26 14:08:17
Solo recojo los que funcionan mejor para mí:
cd <repository-name>
find . -type f | grep -i "\.git" | xargs rm
cd ..
rm -rf <repository-name>
mkdir <repository-name>
cd <repository-name>
git init
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-02 05:30:26
Puede crear un alias para él. Estoy usando ZSH shell con Oh-my-Zsh y aquí hay un alias útil:
# delete and re-init git
# usage: just type 'gdelinit' in a local repository
alias gdelinit="trash .git && git init"
Estoy usando Trash para eliminar la carpeta .git
ya que usar rm
es realmente peligroso:
trash .git
Entonces estoy re-inicializando el repositorio git:
git init
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-02 14:37:52
Hice esto, y funcionó muy bien.
1. Retire el .archivo git del repositorio por rm -fr .git
2. Eliminar la carpeta repo por rm -R path\your_repo_name
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-06-24 12:50:12
Para eliminar completamente el repositorio .git
en su computadora (en Windows 8 y superiores):
- El repositorio
.git
normalmente está oculto en windows - Por lo que debe marcar los "elementos ocultos" para mostrar las carpetas ocultas
- En el sitio superior de su directorio se encuentra la opción" ver "
- Dentro de la opción " ver " se encuentra "elementos ocultos" y marcarlo
- Luego ves el repositorio
.git
luego puedes eliminarlo
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-07 16:50:45
Lo intenté:
rm -rf .git
y también
Git mantiene todos sus archivos en el .directorio git. Sólo quita uno e init de nuevo.
Ninguno funcionó para mí. Esto es lo que hizo:
- Eliminar todos los archivos excepto
.git
- git add . - A
- git commit-m "eliminado todo el proyecto"
- git push
Luego crea / restaura el proyecto desde la copia de seguridad:
- Crear nuevos archivos de proyecto (o copiar y pegar un copia de seguridad)
- git add . - A
- git commit-m"proyecto recreado"
- git push
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-04 18:24:52
En windows:
- Presione el botón de Inicio
- Monitor de Recursos de Búsqueda
- En la pestaña CPU -> type .git - > haga clic derecho en rundll32 y finalice el proceso
Ahora puede eliminar .git folder
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-08 05:14:24
Mensaje cmd de Windows: (Puede probar el siguiente comando directamente en windows cmd si no se siente cómodo con grep, rm-rf, find, xargs, etc., comandos en git bash )
Suprimir .git recursivamente dentro de la carpeta del proyecto mediante el siguiente comando en cmd:
FOR /F "tokens=*" %G IN ('DIR /B /AD /S .git') DO RMDIR / S / Q "% G "
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-29 16:49:36
Solución para Eliminar uno o varios repositorios con respaldo.
Como han mencionado muchos otros. la forma más fácil es usar por @CBbailey
rm -rf .git
desde mac o linux.
Sin embargo, si desea eliminar varios repositorios git y también hacer una copia de seguridad de ellos.
Puedes probar https://github.com/Peripona/bulk-clean-repos
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-06 09:28:31
U también puede eliminar estas carpetas y archivos donde u tiene un repositorio git
Http://storage9.static.itmages.com/i/16/0410/h_1460324963_2968655_d38544bf73.png
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-10 21:51:03
- Remove
/var/www/gitorious
(o donde lo instalaste) - Eliminar servicios en
/etc/monitd
- Eliminar usuario de git
- Eliminar
/usr/local/activemq
y el script de inicio para ello en/etc/init.d/act
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-05-27 11:35:51