libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

GitError: local push doesn't (yet) support pushing to non-bare repos. #1306

Open creatormir opened 2 weeks ago

creatormir commented 2 weeks ago

I have changed a submodule and want to update the repository of this submodule.

    remote = 'origin'
    remote = repo.remotes[remote] 
    repo.config.get_global_config()['safe.directory'] = remote.url  
    res = remote.push(['refs/heads/temp'])

But I get an error: _pygit2.GitError: local push doesn't (yet) support pushing to non-bare repos. At the same time, the console cmd is working: git push origin temp How can I solve this problem via pygit2?