32
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rsyncで.gitignoreにあるファイルを無視してリモートにコピーする

Posted at

-C--filter を使う。

rsync -C --filter=":- .gitignore" -acvz --delete /path/to/project/ user@example.com:/path/to/project/

古いバージョンの rsync だと、 -C.git/ が無視されない場合があるので、新しいバージョンのものを使うと良い。

aliasを設定しておくと便利。

alias rsync-git='rsync -C --filter=":- .gitignore"'
32
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?