Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bitbucket Pipelines CI/CD: SSH into a server to git pull without conflict. Avoid failure when auto merge tries to open editor for commit message.
# This is a sample build configuration for PHP.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.29
- step:
name: Deploy to dev
deployment: dev
# trigger: manual # Uncomment to make this a manual deployment.
- echo "Deploying to dev..."
- pipe: atlassian/ssh-run:0.2.5
SSH_USER: 'root'
MODE: 'command'
COMMAND: 'cd /home/ubuntu/public_html/dev/ && \
git add . && \
git commit -a -m "local files server commit" && \
(echo "OK"; exit 0) || (c=$?; echo "NOK"; (exit 0)) && \
git pull origin feature/development -X theirs --no-commit && \
git commit -m "Merge" && \
(echo "OK."; exit 0) || (c=$?; echo "NOK"; (exit 0))'
- echo "Deployed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment