diff --git a/metagpt/utils/git_repository.py b/metagpt/utils/git_repository.py index 1732d6a91..6e624c8b5 100644 --- a/metagpt/utils/git_repository.py +++ b/metagpt/utils/git_repository.py @@ -142,6 +142,14 @@ class GitRepository: return None return Path(self._repository.working_dir) + def archive(self, comments="Archive"): + """Archive the current state of the Git repository. + + :param comments: Comments for the archive commit. + """ + self.add_change(self.changed_files) + self.commit(comments) + if __name__ == "__main__": path = WORKSPACE_ROOT / "git"