我是 PythonGit 的新手,拉和推有问题。我在本地创建了裸仓库并将初始提交推送给它。之后,我尝试使用 PythonGit 初始化新用户 repo,获取并从中提取。我对初始化存储库没有任何问题,但是我无法从远程/裸存储库中获得任何东西。我的代码:
import git
repo = git.Repo.init('.')
origin = repo.create_remote('origin', '/home/paweber/git/my-repo.git')
origin.fetch()
repo.create_head('master', origin.refs.master).set_tracking_branch(origin.refs.master)
origin.pull()
在用于获取和拉取的 ipython 控制台中,我得到:
In [5]: origin.fetch()
Out[5]: [<git.remote.FetchInfo at 0x7f4a4d6ee630>]
用于获取和
In [6]: origin.pull()
Out[6]: [<git.remote.FetchInfo at 0x7f4a4d6e6ee8>]
拉。拉动操作后,根本没有拉动任何东西,回购仍然是空的,但存在。我做错了什么?