Add CI / CD Basics
40
CI-%2F-CD-Basics.md
Normal file
40
CI-%2F-CD-Basics.md
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
Development only on feature branches, main branch must be assumed to be deployed.
|
||||
|
||||
## 1. Before starting work, rebase current main into your feature branch
|
||||
|
||||
So first, get the latest main branch to your computer
|
||||
```
|
||||
git checkout main
|
||||
git pull
|
||||
```
|
||||
|
||||
Then, go back to your feature branch and rebase
|
||||
```
|
||||
git checkout feature-branch
|
||||
git rebase main
|
||||
```
|
||||
|
||||
If that worked and conflicts are ruled out, push the rebased feature branch from your computer to the repo.
|
||||
```
|
||||
git push origin feature-branch --force-with-lease
|
||||
```
|
||||
|
||||
|
||||
|
||||
However, if conflicts should occur, they need to be manually fixed and then added
|
||||
```
|
||||
git add <conflicted-file>
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
|
||||
## 2. Merging own feature branch
|
||||
When a feature is finished and tested, it should be integrated into the main branch for deployment.
|
||||
So first, repeat the steps from 1 to make sure, the feature branch is compatible with the current main.
|
||||
|
||||
Then, open a Pull Request in the UI. Ideally, someone else reviews it before the merge into main is completed.
|
||||
To avoid ugly merge commit statements, select 'Rebase and fast-forward'.
|
||||
|
||||
If frequent PRs are made, it makes sense to select 'Squash and merge', so that small unspecific commits like "fixed typo" are bundled into
|
||||
a single, more descriptive commit message on main. The detailed commit history is still documented in the PR and on the feature branch.
|
||||
Reference in New Issue
Block a user