Grit を使用してレポを作成し、数回コミットしています。コミットするたびにコミットは保存されますが、古いコミットは消えてしまいます。誰が私が間違っているのか手がかりを持っていますか?
まず、リポジトリを作成してコミットします。コミットをログに記録すると、コミット ID が取得され、すべてが機能します
repo_name = 'repos/myrepo.git'
repo = Repo.init_bare(repo_name)
index = Index.new(repo)
index.add('mytext.txt', "This is my first text")
index.commit('Text commit')
次に、別のコミットを行います
index = repo.index
index.read_tree('master')
index.add('mytext.txt', "This is my second text")
index.commit('Text commit')
.. git log を実行すると、最後のコミットのみが表示されます。この次の行は 1 を返します
repo.commits.count
私が間違っていることは何か分かりますか?Grit で書き込みメソッドを使用する方法に関するチュートリアルが実際に見つかりません。したがって、リンクも歓迎します。ありがとう!