github-workflow.md
June 7, 2021 ยท View on GitHub
GitHub workflow for El Carro
This document provides an overview of the Git/GitHub workflow used by the El Carro project. Following the instructions in this guide helps us streamline development and evolution of the project.
To make your first contribution to El Carro, you should follow the steps below.
-
Create a fork of the El Carro repo
- Visit https://github.com/GoogleCloudPlatform/elcarro-oracle-operator
- Click the Fork button (top right) to create a fork hosted on GitHub
-
Clone your fork to your machine
-
Authenticate yourself to GitHub. We recommend using SSH as described here.
-
Download and install Go if you haven't already
-
Allow builds outside your $GOPATH by running:
export GO111MODULE=on -
Define a local working directory. For example:
export WORKING_DIR="$(go env GOPATH)/src/elcarro.anthosapis.com" -
Set your GitHub user:
export GITHUB_USER={GitHub username} -
Clone your fork
mkdir -p $WORKING_DIR cd $WORKING_DIR git clone git@github.com:$GITHUB_USER/elcarro-oracle-operator.git cd $WORKING_DIR/elcarro-oracle-operator git remote add upstream git@github.com:GoogleCloudPlatform/elcarro-oracle-operator.git # Disable pushing to upstream main branch git remote set-url --push upstream no_push # Verify remotes: git remote -v
-
-
Branch from your clone
-
Before creating a new local branch, always get your local main branch up to date
cd $WORKING_DIR/elcarro-oracle-operator git fetch upstream git checkout main git rebase upstream/main -
Create and checkout a branch as follows
git checkout -b myfeature -
Make your changes. As you make changes, you can and should keep your branch in sync with the upstream by running:
git fetch upstream git rebase upstream/mainUse
git rebaseovergit pullasgit pullcreates merge commits which pollutes the commit history
-
-
Commit and push your changes
-
Once you're done making your changes, stage and commit them by running:
git add . git commit -m "Detailed commit message"Details on how to structure commit messages is provided in the guide for pull requests.
-
Push your changes to your fork by running:
git push -f origin myfeature
-
-
Create a Pull Request
- Visit your fork at https://github.com/$GITHUB_USER/elcarro-oracle-operator
- Click the Compare & Pull Request button next to your myfeature branch. Your Pull Request should be opened against the main El Carro repository as shown in
- Check out the the guide for pull requests for guidance on how to structure and manage your pull requests.