LoginSignup
0
0

More than 5 years have passed since last update.

git-ftp使ってみた

Posted at

無料のレンタルサーバーで簡易なホームページを公開しています。
(基本イベント告知のみなのでWordPressとか使う予定ナシ)

そのレンタルサーバーへはFTPコマンドでアップロードしています。
が、これが実に面倒くさい。

なので今回、git-ftpを使ってみようと思います。
使ってる途中いろいろあったので備忘録として。

Homebrewのインストール

自分でびっくりしたけどHomebrew入れてなかった\(^o^)/
公式サイトを見ながら入れました。
公式サイトによると、下記コマンドを打てばいいようです。
ただ、URLが変わることもあるようなので、公式サイトのコマンドをコピペすべきだと思います。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

git-ftpのインストール

$ brew install git-ftp

これでインストールができたので、次は設定。

$ git config git-ftp.[任意で好きな名前].url [FTPサーバ]
$ git config git-ftp.[任意で好きな名前].user [ユーザー名]
$ git config git-ftp.[任意で好きな名前].password [パスワード]

設定ができたら初期化。

$ git ftp init -s [任意で好きな名前]

これで完了です。
サーバーへFTPする場合は下記コマンドで。

$ git ftp push -s [任意で好きな名前]

☆注意点
git pushをしてしまうと、ftpできなくなります。
(commitがないと判断されるっぽい)
ftp→pushの順がいいです。

0
0
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
0
0