linux git 推送空資料夾

2021-08-16 08:59:06 字數 375 閱讀 8372

git 管理 linux 檔案系統有兩個問題,第乙個是 linux 根檔案系統的 root 許可權問題,第二個就是git不上傳空檔案問題。

一、 root許可權問題的話就得在 root 使用者下git , 只要 su 一下就行了。

二、git 部上傳空檔案問題: 參考:

原理是將所有的空檔案都加乙個 .gitignore 檔案

find . -name .git -prune -o -type d -empty -exec touch {}/.gitignore \;

find . -name .git -prune -o -type d -empty -exec touch {}/.emptyfolders \;

GIT推送時,空資料夾無法新增

自動化 中需要有存放測試報告的位置,但是推送 時又不想把沒用的本地報告推送到gitlab上,所以直接清空了report資料夾,然後pull到gitlab上。然後。一直報錯,找不到指定的目錄。排查發現,git對空目錄無法推送。如果推送乙個空目錄上去,則需要在它下面建立乙個檔案,什麼檔案都行。解決辦法 ...

MFCS刪除資料夾,非空資料夾

bool isdirectory lpctstr pstrpath 去除路徑末尾的反斜槓 cstring strpath pstrpath if strpath.right 1 t cfilefind finder bool bret finder.findfile strpath if bret ...

Git筆記 新增檔案,資料夾,空資料夾

git status 檢視那些檔案被修改,那些檔案待提交 git status on branch develop your branch is up to date with origin develop nothing to commit,working directory clean表示當前沒...