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?

【Git】過去に存在しない未来のファイルの中身を更新して、その過去時間でPUSHするとどうなるのか?

Posted at

やること

過去時間を指定してpushすることで、過去の時間に草が生えることが分かった

では、未来に生まれたファイルを更新して、その内容をPush場合、以下を検証する
・草が生えるのか?
・コンフリクトが起きないのか?(このファイルは存在しないからエラーになるか?)

検証

まず検証前の草の様子

2/13に草が生えていないことが確認できる

image.png

実際にCommitとpushをしていく
すると、エラーが表示されてコンソール上では正常にPUSHできたようだ

未来のファイルの中身を更新後
git add -A
git commit -m "コメント" --date="feb 13 23:59:59 2025 +0900"
[main 48b59fe] コメント
 Date: Thu Feb 13 23:59:59 2025 +0900
 1 file changed, 3 insertions(+)
git push 
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 20 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 388 bytes | 388.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote: This repository moved. Please use the new location:
remote:   https://github.com/TKWebSE/AtCoder.git
To https://github.com/TKWebSE/Atcoder.git
   bb3f03f..48b59fe  main -> main

草を確認すると、期待通り2/13のところに草が生えていた

image.png

結論

過去に存在しないファイルを更新しても、草は生える!!

before

image.png

after

image.png

参考

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?