![](/img/trans.png)
[英]Git : How to remove only empty directories(not un-tracked files) in a git repo
[英]How to add only all dot files and directories to a git repo?
如何僅將所有點文件添加到 git 存儲庫? 我試過了:
$ gitc add .*
fatal: ..: '..' is outside repository
另外,除了.mozilla,如何在git中遞歸地只添加所有點目錄?
這個最好用a.gitignore來處理,然后就可以放心使用git add.
.
從里到外寫它可能是最簡單的:忽略所有內容,然后有選擇地取消忽略。
/*/
!/.*/
!.gitignore
/.mozilla/
這是一個測試目錄。
.
├── .gitignore
├── .mozilla
│ └── no
├── .no
├── .yes
│ ├── .gitignore
│ ├── .mozilla
│ ├── .yes
│ └── yes
└── no
這是git add.
看到。
new file: .gitignore
new file: .yes/.gitignore
new file: .yes/.mozilla
new file: .yes/.yes
new file: .yes/yes
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.