6
12

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 1 year has passed since last update.

[Github]草を生やし忘れた過去に戻って草を生やしたい!

Last updated at Posted at 2021-07-08

##はじめに
本記事は過去日付に戻ってcommitする方法について記述したものです。

私は毎日草を生やすことを意識してやってましたがまさかのcommit忘れ
絶望して打ち拉がれていました。。。

スクリーンショット 2021-07-08 19.33.08.png

しかし、調べてみると過去に戻ってcommitできることが判明しました!(タイムマシーン)
多用厳禁ですww

本題

結論以下のようなコードで遂行することができます。

git commit -m "コメント" --date="Jul 7 23:59:59 2021 +0900"

オプションとして--dateを指定し上記のように日付を指定することで実行できます。

ものすごく便利な機能なので、多用してしまうと毎日コミットする癖が抜けてしまう可能性ありです。
みなさんも--dateは度を越さないに使ってみてはいかがでしょうか。

##参考

6
12
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
6
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?