0
0

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.

ローカルの変更ファイルをリモートに転送する方法

Last updated at Posted at 2017-03-17

開発環境がサーバにしかなくて困る:scream:
そんなとき!

ローカルの変更ファイルだけをtarで固めてリモートに転送できたら便利です。

実装

①git status -uの結果がMのものだけをtmpファイルに書き出す。
②tmpファイルに書き出された変更ファイル名を表示する。

tmp file
------------
aaa.text
bbb.text
ccc.text
------------
Is this ok? yes/no

③表示されたファイルが意図したものである場合は場合はyes,意図したものでない場合はnoと入力する。
④noの場合は終了、yesの場合は実行するコマンドを表示して実行。

${KEY} = /home/key/
${DIR} =
${} =
※configで定義した場所に転送するようにする。

tar |ssh ...(実行コマンド)

finish!
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?