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

如何在CVS仓库的子目录中添加新目录?

Fixing CVS Add Subdirectory Error: "there is no version here; do 'cvs checkout' first"

Ah, I’ve run into this exact CVS quirk before! The issue stems from CVS’s strict rules about tracking directories and where you can run commands—let me break down why your approach isn’t working and walk you through the correct workflow.

Why Your Current Method Fails

That error message usually signals one of two problems:

  • You’re trying to run cvs add in a directory that’s not tracked by CVS (no .CVS subfolder exists there), even if you checked out the parent directory.
  • You might be accidentally working directly in the server-side repository filesystem instead of your local checked-out workspace. CVS requires all changes to go through a local checkout, not direct server edits.

Correct Steps to Add a Subdirectory

Follow these steps to properly add a new subdirectory inside repository/directory:

  • Step 1: Confirm you’re in a tracked local workspace
    Navigate to your local checked-out project root (where the top-level .CVS folder lives). If you’re in repository/directory, double-check that a .CVS subfolder exists here. If not, run cvs checkout repository/directory to pull the tracked version of this directory.

  • Step 2: Create the new directory locally
    Run the standard mkdir command to create your folder:

    # If you’re at the project root
    mkdir repository/directory/new_dir_name
    
    # Or if you’re already inside repository/directory
    mkdir new_dir_name
    
  • Step 3: Tell CVS to track the new directory
    From either the project root or the repository/directory folder (the one with .CVS), run:

    # If inside repository/directory
    cvs add new_dir_name
    
    # If at the project root
    cvs add repository/directory/new_dir_name
    

    You’ll see a confirmation message like Directory /path/to/repository/directory/new_dir_name added to the repository.

  • Step 4: Commit the change to the repository
    This is critical—CVS won’t actually create the directory in the remote repo until you commit it:

    # Commit just the new directory
    cvs commit -m "Add new subdirectory: new_dir_name" repository/directory/new_dir_name
    
    # Or commit all pending changes if you prefer
    cvs commit -m "Add new subdirectory and updates"
    

Extra Tips to Avoid Future Issues

  • Never edit or create folders directly in the server-side CVS repository (e.g., the CVSROOT or project repo folders on the server). Always use your local checkout.
  • If you get the "no version here" error again, run cvs update in the parent directory to sync your local workspace with the repository.
  • After adding the directory, you can add files inside it with cvs add as usual, then commit those files separately or in the same batch.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 03:18:27