Cannot remove git repository completely

can't delete git folder windows
cannot remove git objects permission denied
git delete local
remove git from folder
git delete local repository
remove embedded git repository
remove git from computer
how to remove git repo from computer

I have been using git on windows-msysgit. Whenever I try to remove a repository completely either using explorer or using

$ git rm -rf ptp/
fatal: Not a git repository (or any of the parent directories): .git

it errors out "The data present in the reparse point buffer is invalid" or the fatal error above.

What's wrong with me/git?

Thanks in advance

To remove a git repo, just do rm -rf ptp/. That's it. git rm is used to move items from the index [the staging area for changes / new files], not to delete git repositories.

Why does Git for Windows create repositories that I can't delete from , Found a solution: I just rename the .git folder to another name and remove it. Confirm the deletion of the repository by typing the repo's name and selecting Delete. Select the settings icon in the web to bring up the project administration page and choose Version Control . Select the Git repository to remove from the list shown and select the next to the name.

To get rid of the git repository on Windows do this:

Win+R, Type cmd, Enter.

> cd c:/path/to/parent/of/ptp-repo
> rmdir /S /Q ptp

Or if it fails then check who locks the directory and delete it by hands from Explore.

Most likely some process holds a lock on files/dirs in your repo.

ssh - Cannot delete .git directory, Download 'BFG Repo-Cleaner' here. This tool claims to work 10-720x faster than any other method, but you cannot specify a subdirectory, it will delete all files with​  Right-click the folder and choose Delete. It will goes to Recycle bin. Note: this works for Git Clone and Git Init.

I tried to remove GIT on my windows-XP, by means of the Windows/Configuration/Software menu. After some error message (which I cannot remember), it removed all files. I checked it, and there are no files with ptp in the name left on the entire system.

A problem remained however: each time I opened windows-explorer, a nasty error message came calling for a dll file that wasn't there anymore.

When checking the registry, there were many traces to GIT left in the registry. I removed them carefully by hand, which seems to have solved the problem. This is of course a dangerous path, but I had no choice. Perhaps it is a good idea to look into the Windows-deinstallation script very carefully.

Stef Joosten

How to completely remove a file from a Git repository, Learn how you can easily delete Github repository by navigating your repository list and deleting your repository using the user interface. According to the screenshot, you only have one repository in your team project. You cannot remove a repo if it is the only Git repo in the Team Project. If you need to delete the only Git repo in a Team Project, create a new Git repo first, then delete the repo. Also you need to make sure you have the Delete Repository Permission.

On Windows 10, try running cygwin console as admin and rm -rf the dir.

How To Delete a GitHub Repository – devconnected, Issue Type: Bug create a folder named "test" git init it open this folder in vscode (​with all user extension disabled) try delete it in vscode or in file  But for Private project, please follow the steps for Gitlab: Login to your account Click on Settings -> General Select your Repository (that you wants to delete) Click on 'Advanced' on the bottom-most Click on 'Remove Project' You will be asked to type your project name This action can lead to data

I have also just experienced this odd problem on windows 10: An empty .git folder simply would not delete and a restart of windows did not remedy it, nor did rmdir .git, nor did rm -rf .git.

Similarly to another suggestion, I used ubuntu (instead of cygwin) for windows ( and issued an rm -rf .git, that worked perfectly

Git: Can't delete a git repo folder which is open in vscode · Issue , To remove a large file from your repository, you must completely remove it from your local repository and from GitHub. To start cleaning, remove changes to files you’re already tracking in your repository: $ git reset --hard HEAD This resets the contents of your project to their state at your most recent commit (HEAD). Again, the --hard flag is destructive–if you don’t have a backup of your work-in-progress, it’s gone!

Removing files from a repository's history, I'm having trouble deleting the Git repository in TFS. I created this repository for testing, I searched for content like deleting it but there is only the  I found that, in Windows 10 at least, using the task manager to stop all git processes is enough to free up the files so they can be removed. Then simply restart git and you are good to go. No reboot required.

Cannot delete git repo, git-rm - Remove files from the working tree and from the index working tree is dirty so that you cannot use git commit -a ), use the following command: from the work tree, as their repository lives inside the .git directory of the superproject. This can result in our repository quickly growing in size. Enter git-forget-blob # Completely remove a file from a git repository history # # Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> # GPL licensed (see end of file) * Use at your own risk!

git-rm Documentation, Therefore, we can't simply remove the files and commit this as this would also in case you want to remove such data from your Git repository. So, you can permanently remove a folder from a git repository with: git filter-branch --tree-filter 'rm -rf vendor/gems' HEAD Which will go through the whole commits history in the repository, one by one change the commit objects and rewrite the entire tree.

  • Does the windows restart help? :)
  • No! It is still there. I can only rename the parent folder but cannot remove the file ta05636 with size of 0 bytes. Is this a measure Microsoft takes against Git? :)
  • Loading Windows in Safe mode and erasing will definately 'fix' this issue. Some process in your normal startup is accessing that file and Windows isn't allowing you to erase it. Using safe mode, you will basically limit which processes start up, thus allowing you to delete it. If the process STILL starts up in safe mode, you might have to boot your computer with a linux LIVE disc (pick your flavor) and delete it that way...
  • Knoppix is a good choice.
  • Live Mint is also a great choice!
  • +1, but be warned -- git rm will delete files from your working directory, provided they are also removed from the index, and have no unstaged or staged changes. Fortunately, in these cases you can always get them back from the version history.
  • No way! $ rm -rf ptp/ rm: cannot remove directory ptp/.git': Directory not empty rm: cannot remove directory ptp': Directory not empty And got that: hoppala@HOPPALANINYERI /d/Projects/ptp/ptp/.git $ ls ta05636 hoppala@HOPPALANINYERI /d/Projects/ptp/ptp/.git $ rm -rf ta05636 hoppala@HOPPALANINYERI /d/Projects/ptp/ptp/.git $ ls ta05636
  • That's definitely odd. This probably has more to do with some problem on Windows, rather than with git itself.
  • Right. I think Win7 is the culprit.
  • this is most probably a permission issue or process locking the directory. got the same problem here at MacOSX
  • Here is the outcome :( D:\Projects\ptp>rmdir /S /Q ptp ptp\GIT~1\ta05636 - The data present in the reparse point buffer is invalid. I tried WhoLockMe but it chrashed as I am using Win7. Is there any other way to discover 'the locker'?
  • I used Unlocker. It says there is no locking handler on the folder :s It didnt remove the file even though I went with 'delete on the next restart' option.
  • Explorer won't display the .git folder and rmdir says that it isn't allowed because the folder isn't empty...