从delphi代码将文件推送到GIT版本控制的问题

从delphi代码将文件推送到GIT版本控制的问题,git,delphi,github,Git,Delphi,Github,我试图将文件提交到GIT,然后从delphi代码将它们推送到GitHub 请参阅以下代码: 我在以下位置遇到访问冲突: git_远程连接(远程、git_直接推送); git_remote_pushspec(远程) 我在下面的线路上遇到访问冲突 git_远程连接(远程、git_直接推送); git_remote_pushspec(远程) 有谁能告诉我这里缺少什么,以及如何连接github并从代码中将一些文件推送到那里 谢谢 b我删除了我的答案,因为您实际使用的代码似乎与问题中的代码非常不同。而且,

我试图将文件提交到GIT,然后从delphi代码将它们推送到GitHub

请参阅以下代码:

我在以下位置遇到访问冲突:

git_远程连接(远程、git_直接推送); git_remote_pushspec(远程)

我在下面的线路上遇到访问冲突

git_远程连接(远程、git_直接推送); git_remote_pushspec(远程)

有谁能告诉我这里缺少什么,以及如何连接github并从代码中将一些文件推送到那里

谢谢
b我删除了我的答案,因为您实际使用的代码似乎与问题中的代码非常不同。而且,似乎你正在寻找的不仅仅是解释为什么你会得到AV。我想我不能提供。对不起,你误解了。我在回复你的评论-“dll不包含git_remore_new函数。如果我执行代码“git_remote_new:=Bind('git_remote_new','20');“那么,我没有得到任何异常,因此显示dll包含该函数。是的,我的问题中不包括此代码,因为在加载dll时它已在最初执行。对此,我深表歉意。”。
uses uGitForDelphi;

procedure TfrmMain.CommitClick(Sender: TObject);
var
   repo: Pgit_repository;
   commit: Pgit_commit;
   tree_id, parent_id, commit_id: git_oid;
   author, committer: Pgit_signature;
   author1, committer1: Pgit_signature;
   parent: Pgit_commit;
   tree: Pgit_tree;
   index: Pgit_index;
   head, branch: Pgit_reference;
   remote: Pgit_remote;
   const
   branch_name: PAnsiChar = 'refs/heads/master';
begin

   git_repository_open(repo, REPOSITORY_FOLDER);

   git_oid_fromstr(@tree_id, tree_oid);


   git_oid_fromstr(@parent_id, PAnsiChar(commit_ids[4]));


   git_reference_lookup(head, repo, 'HEAD');
   git_reference_set_target(head, branch_name);

   git_repository_index(index, repo);
   git_index_entrycount(index);
   git_index_add(index, 'TestingNewfile.txt', 0);

   //* create signatures */
   git_signature_new(committer, COMMITTER_NAME, COMMITTER_EMAIL, 123456789, 60));
   git_signature_new(author, COMMITTER_NAME, COMMITTER_EMAIL, 987654321, 90));

  git_commit_create_v(
      @commit_id, //* out id */
      repo,
      'Head', //* do not update the HEAD */
      author,
      committer,
      nil,
      COMMIT_MESSAGE,
      tree,
      1, parent));

   git_commit_lookup(commit, repo, @commit_id));

   //* Check attributes were set correctly */
   author1 := git_commit_author(commit);

    committer1 := git_commit_committer(commit);

   *git_remote_new(remote,repo, 'https://github.com/iambasiljoy/Jungle', 'Jungle');
   git_remote_connect(remote,GIT_DIR_PUSH);
   (git_remote_pushspec(remote));
 //  git_commit_free(commit);
//   git_repository_free(repo);*
end;