How to delete folder in GitLab using console

46,006

Solution 1

Git doesn't track directories, only their contents. But git rm -r src should have done it. Here's possible things to check.

Was the git push successful? If not, then the remote will not be updated.

Double check that origin is what you think it is with git remote -v.

Double check that you're looking at the right branch, master.

If you're talking about what Gitlab displays in a web browser, make a new clone of your repository and check if src is still there. If it isn't then it's probably an issue with their web display, possibly a caching issue.

If after you've done all that and are still flummoxed, contact Gitlab about it.

WRT git rm --cached, the --cached refers to the staging area (also called the cache, also called the index). It's where git add copies files to build up the next commit. It lives on your machine and has nothing to do with your problem.

Solution 2

For me it worked with gitlab web IDE. I just deleted a folder and committed it and also I renamed my project's folder name.

So I think we can do this with WEB IDE.

Share:
46,006
Admin
Author by

Admin

Updated on November 27, 2020

Comments

  • Admin
    Admin over 3 years

    I have wrongly created a folder named src in my GitLab repository and now I want to delete this folder. I have tried several ways to delete it but I am able only to delete it locally but not in my GitLab repository. This folder is still there and i want to get rid off it. I have tried those commands

    git rm -r src   
    git commit -m "Remove  directory"   
    git push -u origin master
    

    but it still does not delete the folder in my GitLab repository.

    I have also tried this :

    git rm -r --cached src
    

    and none of them seems to work for me .