簡體   English   中英

rsync git項目文件夾

[英]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

因此它可能會跳過文件...

使用git

無論如何,在對源目錄進行版本控制時,不需要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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM