top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Removing a GIT repository

0 votes
272 views

I made some mistakes in the way I set up my initial repository, and Id like to start from scratch. How can I completely remove a repository so I can start over? I am running git from the command line on Linux Ubuntu. Can I simply send the .git directory to the trash and empty the trash?

posted Dec 5, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Yep, that would be sufficient.

I usually go rm -rvf .git. (The -f is required since by default all the Git objects are readonly.)

If you want to make sure it is erased completely and cannot be recovered use shred or srm. The usual methods like rm or emptying the trash just remove the *addresses* of the files and folders. They don't actually destroy the file contents.

answer Dec 5, 2017 by Honey
Similar Questions
0 votes

I think there's a bug in git pull. Doing a git pull in a fresh repository without any commits removes files in the index.

Example:

$ mkdir foo
$ cd foo
$ git init
$ touch file1 file2
$ git add file1
$ ls
file1 file2
$ git pull https://github.com/sos4nt/empty.git master
$ ls
file2

"file2" is still there, but "file1" was silently removed and no error message was shown.

I'm running git 1.8.3.1

+1 vote

How to configure a read-only copy of a remote Git repository on a local server in bare mode and automatically synchronize its contents.

I need to configure a mirror of the repository hosted at another location and the mirrored repository should automatically perform syncing of code at regular intervals.

+3 votes

When we clone a remote GIT repository, all folders/files will be cloned. This will consume lot of disk space in our local machine.
Is there a way to clone only few folders & exclude others?

This is possible in clearcase snapshot view by changing load rules.

+1 vote

There's a challenge that i'm currently facing after migration from WINCVS to GIT. The problem here is I need to pull/fetch a specific branch (and NOT clone the entire repository) from the repository to a particular location on the AIX server.

Earlier while using WINCVS this functionality was achievable using JCVSExport package as we could just checkout a particular branch and fetch the package on to the server location.
WINCVS Command : java JCVSExport -h cvs.xyz.com -u abcde -p xxxxxx -d /abcd/cvs/testing -c "$REPOSITORY" -m "$PACKAGE"

I am not able to achieve the same functionality using GIT. I DO NOT want to clone the entire repository on the AIX server instead I just want to fetch/pull a specific branch contents on the server. Can someone please help me out with the solution or any possible way with which I can achieve the same functionality.

+2 votes

I have a local repository and want to change the master branch to a server git. (I just don't want to delete all files in repository and then clone the server files)How to do that? I guess I have to fetch server data into local directory, merge an push it. Can someone please explain me how to do?

...