All of these examples use the concourse/git-resource image. That image is probably the most popular git resource for Concourse since it is shipped in the concourse/concourse image and in the tarball on the GitHub release page. It is not the only resource available for working with git-related resources. If you don't see your use-case on this page then there is probably another resource that you can use. For example, Pull Request workflows can be accomplished with the teliaoss/github-pr-resource.
Check out the docs for the git resource for all configuration options.
Here is how you fetch the contents of a git repository and use it in a task.
resources: - name: concourse-examples type: git icon: github source: uri: https://github.com/concourse/examples jobs: - name: read-the-readme plan: - get: concourse-examples - task: cat-readme config: platform: linux image_resource: type: registry-image source: repository: busybox inputs: # pass concourse-examples into this task step - name: concourse-examples run: path: cat args: ["concourse-examples/README.md"]
Here is how you can merge two branches. Common if you are using gitflow and need to merge a
dev branch into
main every so often.
resources: - name: repo-main type: git icon: github source: uri: https://github.com/user/my-repo branch: main - name: repo-dev type: git icon: github source: uri: https://github.com/user/my-repo branch: dev jobs: - name: merge-dev-into-main plan: - get: repo-dev - put: repo-main params: repository: repo-dev merge: true