Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Remove git repo without deleting the contents inside the repo path

Discussion in 'General Discussion' started by luissquall, Aug 27, 2018.

  1. luissquall

    luissquall Member

    Joined:
    Jun 27, 2014
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    México
    cPanel Access Level:
    Root Administrator
    Hi,

    By mistake I created a repo using "Git™ Version Control" ui on a path I would like to keep even if it is not associated with a repo. I created a new repo to test what happens when you delete a repo and unfortunately everything inside the repo was deleted.

    Is there any way to remove the repo from "Git™ Version Control" list without deleting the files inside? I tried deleting only the .git folder but repo didn't disappear from the list. Where does cPanel/WHM keep track of this info? (Making a backup of the folder to delete the repo is my last option, I have around 100GB in the folder and the website is busy)

    I think is dangerous not having an option / checkbox to keep the contents.

    Thank you!
     
    #1 luissquall, Aug 27, 2018
    Last edited: Aug 27, 2018
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    46,968
    Likes Received:
    2,119
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @luissquall,

    When you delete a repository, the system permanently deletes the entire contents of the repository's directory. You cannot recover this data after deletion. If you'd like to preserve the data, you must use SSH, FTP, or File Manager to copy or move the files and directories that you want to preserve to another location.

    We do restrict the creation of Git repositories on cPanel-controlled directories:

    However, this is not extended to user-created directories. I encourage you to open a feature request if you'd like to see an option to preserve the contents of the directory, and remove just the Git repo itself:

    Submit A Feature Request

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. luissquall

    luissquall Member

    Joined:
    Jun 27, 2014
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    México
    cPanel Access Level:
    Root Administrator
    Thank you @cPanelMichael! I was hoping editing a yaml file or something could help me. I'll open a feature request then.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    46,968
    Likes Received:
    2,119
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @luissquall,

    cPanel & WHM version 76.0.4 was published today and includes the following change:

    Fixed case CPANEL-21276: Git version control no longer removes files from repository.

    Here's an updated description of what happens when you remove a repo via cPanel >> Git Version Control in cPanel & WHM version 76.0.4 and later:

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    APatchworkBoy likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice