【发布时间】:2017-05-18 22:58:16
【问题描述】:
我在 Github 上有一个带有 Javadoc cmets 的大型 Java 项目。上面有 Travis CI 链接。成功后,我想生成项目的文档并将其推送到一个名为...“doc”的分支上!
在 Travis CI 上成功构建后会启动一个 bash 脚本:
#!/usr/bin/env bash
# If error, return 0
set -e
# Repo
REPOSITORY="git@github.com:xxx/yyy"
# Clone repo to work in (repo_clone dir)
git clone ${REPOSITORY} repo_clone
cd repo_clone
# Go into doc branch, create it if not exist (first time only)
git checkout doc || git checkout --orphan doc
git config user.name "Travis CI"
git config user.email "doc@backtothefuture.go"
# Generation of doc
javadoc -private -sourcepath "src/main/java:src/main/ressources" \
-d doc \
marche.traitement.exceptions \
marche.traitement.label \
marche.traitement.marche \
marche.traitement.participant \
marche.traitement.production \
marche.traitement.produits
# Add new dir (all dir but only doc/ is impacted
git add .
git commit -m "There is the doc Marty !"
git remote add origin ${REPOSITORY}
# Push
git push origin doc
但有时我会遇到这个错误
fatal: remote origin already exists.
有时这个:
error: src refspec doc does not match any.
error: failed to push some refs to 'git@github.com:GeeksdelaCave/aidons-les-fermiers.git'
取决于未成年人的适应情况。
如何解决?
【问题讨论】:
标签: java git bash github travis-ci