You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

推送至GitHub Master分支后子文件夹锁定问题求助

Troubleshooting the Locked borroup Folder on GitHub

Hey there! Let's figure out why your borroup subfolder is showing a locked status on GitHub, and walk through how to fix it. This issue is almost always tied to nested Git repositories or submodules—here's what to check:

1. Verify if borroup is a nested Git repository

GitHub displays a lock icon when a folder is actually an independent Git repo (with its own hidden .git folder inside it). Here's how to confirm:

  • On Mac/Linux: Open your terminal, navigate to the borroup folder, and run ls -la. Look for a .git folder (it’s hidden by default).
  • On Windows: Open Command Prompt, go to borroup, and run dir /ah to show hidden files. Check for a .git folder.

Fix for nested repos:

If you don’t need borroup to be a separate repository, follow these steps:

  1. Delete the hidden .git folder inside borroup:
    # Mac/Linux
    rm -rf borroup/.git
    
    # Windows (Command Prompt)
    rmdir /s /q borroup\.git
    
  2. Return to your parent repo’s root directory, then update and push your changes:
    git add borroup/
    git commit -m "Resolve locked folder by removing nested Git repo from borroup"
    git push origin main
    
  3. Refresh your GitHub repo page—the lock icon should disappear!

2. Check if borroup is a Git submodule

If you accidentally set up borroup as a Git submodule, GitHub will also mark it as locked. Verify this by running this command in your parent repo’s root:

git submodule status

If you see an entry for borroup, it’s a submodule.

Fix for submodules:

Remove the submodule and re-add borroup as a regular folder:

  1. Deinitialize and remove the submodule:
    git submodule deinit -f borroup
    rm -rf .git/modules/borroup
    git rm -f borroup
    
  2. Re-add the folder and push changes:
    git add borroup/
    git commit -m "Remove submodule status for borroup folder"
    git push origin main
    

3. Rule out GitHub display caching

Sometimes the lock icon is just a temporary display glitch. Try:

  • Refreshing the GitHub repo page hard (hold Ctrl+F5 on Windows, Cmd+Shift+R on Mac)
  • Opening the repo in an incognito/private browsing window
  • Waiting 5-10 minutes for GitHub’s backend to sync your latest push

内容的提问来源于stack exchange,提问作者Amer Bearat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:52:54