LoginSignup
0
1

More than 3 years have passed since last update.

git commitくらい自動でやってほしい

Last updated at Posted at 2020-12-26

gitへのコミットとgithubへのpushをやるのも手間な堕落人間のシェルスクリプト。

対象外ファイルは事前に.gitignoreへの追記をお忘れず(もし重いファイルなどが追加されてしまうとgitからの消去が非常に面倒)

autocommit.sh
today=$(date "+%Y%m%d")

cd なにかのディレクトリ
git add .
git commit -m "自動コミット_${today}"
git push hogehoge master

crontabで1日の終わりなどに、その日の作業内容をすべてコミットするようにした。

55 23 * * * /Users/hogehoge/autocommit.sh 1> /Users/hogehoge/cronlog/autocommit_`date +\%Y\%m\%d\%H\%M\%S`.txt 2> /Users/hogehoge/cronlog/autocommit_error`date +\%Y\%m\%d\%H\%M\%S`.txt
0
1
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
1