使用Bitbucket流水线将代码推送到另一个仓库

3

我在Bitback中有两个仓库,分别是仓库A和仓库B。 我希望当有人在仓库A提交代码时,自动触发流水线并将我的代码复制到仓库B。 目前我使用了这样的流水线,但是出现了错误。

error: src refspec devops-test does not match any.
error: failed to push some refs to

管道
 - date > test.txt  
 - git remote add two https://login:passwd@repo.git
 - git add .
 - git commit -m "push [scip ci]"
 - git push two devops-test --force

devops标签说明中可以看到:“与编程无关的问题应该在DevOps Stack Exchange网站上提问”。 --- 这个问题可能更适合在DevOps上提问。 - Turing85
1个回答

1
clone:
  depth: full 
pipelines:
  branches:
    uat:
      - step:
          script: 

            - echo "sonar reports"
            - apt install -y git
            - git remote add new https://priya400:yxv7WQjgDJRZZaJNBndC@bitbucket.org/bbc-test4/firstrepo.git
            - touch test111.txt
            - git add .
            - git commit -m "push to remote"
            - git push new aws/client:devops-test --force```

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接