Running Commands with Contexts

Learn how to push code changes to the remote Git repository.

Overview

The final step your Go CI has to perform is pushing code changes to the remote Git repository. For this step, you’ll use some concepts from the Git Version Control System, such as commits, local and remote repositories, branches, and pushing commits to remote repositories.

If you need more information about these concepts, take a look at Git’s official documentation. And if you want to try this tool locally, you’ll also need Git installed on your machine.

To push code, you’ll add another step to your pipeline to execute the command git with the appropriate options. For now, let’s simplify it and assume that we’re pushing code to the remote repo identified by origin using the branch master. The complete command is git push origin master.

Get hands-on with 1400+ tech skills courses.