有没有办法将python spyder与github连接起来?
我通过github管理我的R脚本,因为R提供了接口,使用户可以提交、拉取和推送,但我想知道是否有同样(或类似)的系统在python(x,y)spyder中。
我想使用github来管理我的Python脚本,而不仅仅是在本地编辑我的代码,并每次手动编写更改日志。
Spyder已经集成了命令行git。
https://github.com/spyder-ide/spyder/issues/6105
First right click the tab corresponding to any file in your repository and click "set console working directory."
Then go to the Ipython window in Spyder and simply type your git commands (assuming Git is installed and its paths are configured properly) but append a "!" to the beginning of your command:
!git add "file.py" !git commit -m "My commit" !git push origin master
(Spyder的开发人员在此) 很抱歉,目前(2017年2月)Spyder和Git/Github之间没有集成。
此外,还没有具体计划添加这种支持。我们可能需要一年或一年半的时间来实现。
Github上相关问题链接:https://github.com/spyder-ide/spyder/issues/816
因此,我没有点击“设置控制台工作目录”,而是在Spyder中的ipython控制台中执行了以下操作(我使用的是Mac OSX Mojave,并已从Appstore安装了Xcode):
将工作目录初始化为git目录
!git init
拉取现有存储库以与您要推送的文件合并
!git remote add origin https://github.com/myUserName/sample.git
将该文件添加到本地Git
!git add temp.py
将文件推送到github.com
!git push -u origin master