(20251205)清理 Play 2.1 專案的建置產物

| Work Notes | 0 Reads

最近在 VS Code 的變更列表裡冒出三百多條修改,主要是 Play/SBT 的建置產物與 Ivy 快取。它們可隨時重建,不應納入 Git。以下記錄這次清理過程。

操作步驟

  1. 在倉庫根目錄更新 `.gitignore`,加入 Play/SBT 生成的目錄(`application/tsk/target`、`.target`、`logs`、`RUNNING_PID` 等)以及本地 `repository` 快取。
  2. 移除不存在的路徑(如 `dist`、`.history`),避免 `git rm` 報錯。
  3. 將已被追蹤的產物從索引移除:
   cd "/c/Program Files/play-2.1.5/play-2.1.5"
   git rm -r --cached \
     application/tsk/target application/tsk/.target application/tsk/logs \
     application/tsk/RUNNING_PID \
     application/tsk/project/target application/tsk/project/project \
     repository
   git status

+:

git rm --cached application/tsk/.project

 

This article was last edited at