23
24

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 2016-06-01

PSDとかSketchなんかのデザインファイルもGitで履歴を追えるようにしたいんだけど、
プログラミングと違って、ついついコミットするの忘れてしまうので自動化

~/scripts/auto_commit.sh
#!/bin/bash

while true
do
  git add .
  git commit -m 'auto commit'
  sleep 300
done

この場合5分毎に、変更がある場合に自動的にコミットしてくれる

こいつをターミナルからgitディレクトリの中で実行しておく

$ ~/scripts/auto_commit.sh
[master abcd123] auto commit
 1 file changed, 0 insertions(+), 0 deletions(-)
[master efgh456] auto commit
 1 file changed, 0 insertions(+), 0 deletions(-)
23
24
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
23
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?