[英]Moved local git folder and now its asking to stage most of my project files?
[英]rsyncing git project folder
我需要rsync一個git項目文件夾,並且我正在使用以下rsync標志-r -a -v -u -W,但是當我在目標文件夾上運行git status時,它與源上的git status不匹配(我得到了修改/刪除的文件,但實際上並沒有被觸及)。
為什么會這樣呢? 以及如何使其按預期工作?
從rsync手冊:
-u, --update skip files that are newer on the receiver
因此它可能會跳過文件...
無論如何,在對源目錄進行版本控制時,不需要rsync。
克隆文件夾
cd /my/destination
git clone /my/source/repo
同步文件夾
cd /my/destination/repo
git fetch
我通常使用的rsync
命令是
rsync --archive --delete --verbose src-dir/ dst-dir/
這使得dst-dir
的精確鏡像src-dir
。 這將拾取所有內容,包括您的.git
子目錄和未跟蹤的文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.