略
示例脚本:
#!/bin/bash# terminate on errorset -e cd $JENKINS_HOMEecho "Recent changes:"git log -5 --pretty=oneline --stat echo "Checking status of $JENKINS_HOME"git status echo "Adding new files..."git add . echo "Git status:"git status echo "Committing changes..."# Only try commit if something changed, otherwise this produces an error.git diff-index --quiet HEAD || git commit -m "$GIT_COMMENT" # Push changes upstreamgit push