2016-01-18 50 views
0

我试图after_success特拉维斯CI推动建立新仓库

下面的脚本是由特拉维斯运行一次构建完成时的特拉维斯CI项目的建成版推到不同的存储库:

git config user.name "Travis CI" 
git config user.email "[email protected]" 
git config --global push.default simple 
git add . -f #force adding to include files in .gitignore 
git commit -m "built with love by travis <3" 
git remote add production https://${GH_TOKEN}:[email protected]/my_username/repo.git 
git push production master --force #ensure repo is in correct state 

GH_TOKEN是存储在.travis.yml中的加密github令牌显然,我编辑了一些私人信息。

当该脚本由特拉维斯运行,我收到以下错误:

remote: fatal: did not receive expected object [redacted] 
error: unpack failed: index-pack abnormal exit 
To https://[redacted token]:[email protected]/my_username/repo.git 
! [remote rejected] HEAD -> master (failed) 
error: failed to push some refs to 'https://[redacted token]:[email protected]/my_username/repo.git' 

这是我的脚本,特拉维斯,或github上有问题吗?

+0

请问您的OAuth令牌有正确的特权?尝试在其配置中勾选更多框。 –

回答

0

我不太确定是什么问题了,不过我修改了我的脚本来初始化特拉维斯内一个新的空git仓库和一切工作顺利:

rm -rf .git/ 
git init 
git config user.name "Travis CI" 
git config user.email "[email protected]" 
git config --global push.default simple 
git add . 
git commit -m "built with love by travis <3" 
git remote add production https://${GH_TOKEN}@github.com/user/repo.git 
git push production master --force