我正在尝试做一个python脚本来检查我的git本地工作文件夹中的更改,并自动将它们推送到在线回购站。目前只能手动使用git来完成它。我想知道,脚本需要什么来做到这一点,而无需人工干预。如何使用gitpython自动推送回购
我输入我外壳的命令是:
#for checking the status, and determining if there are untracked files
git status
#if there are untracked files...add them
git add .
#add my commit message
git commit -m "7/8/2012 3:25am"
#push it to my online repo
git push origin master
#check if changes came on remote
git diff origin/master
#merge my repo with origin
git merge origin/master
当做混帐推,你总是要输入用户名/密码。我知道git有一个解决这个问题的方法,它涉及到制作ssh密钥等等。但我认为GitPython正在做某种方式。我的意思是我们可以通过代码传递用户名/密码,或者与前者通信。那么当我使用GitPython时,我有哪些关于认证的选项?
编辑:有些应用程序实际上会生成ssh密钥,例如, github的windows应用程序。 Windows应用程序如何做到这一点?我的假设是肯定有一些git API ...
通常不建议将密码存储在脚本中。 – soulseekah 2012-07-09 12:46:16