... | ... | @@ -11,7 +11,7 @@ The strategy is the following : |
|
|
### Strategy A
|
|
|
Advised for "small" modifications.
|
|
|
|
|
|
![stratSimple](/uploads/43a74baf9bb15ac10e2d40ee4aea0df3/stratSimple.png)
|
|
|
![stratSimple](/uploads/183ad7b079ea397d781d6305f9f8c31c/stratSimple.png)
|
|
|
|
|
|
* Create a local branch to host your modifications `git checkout -b work-branch` where `work-branch` is the name of your branch
|
|
|
* Work and commit freely
|
... | ... | @@ -30,7 +30,7 @@ git merge master |
|
|
* Merge and squash `work-branch` into `work-branch-patch`: `git merge --squash work-branch`. The proposed commit message aggregates all the commit messages of branch `work-branch`. **Edit this commit message** so that is is meaningful for other users (remove what is not necessary).
|
|
|
* Push `work-branch-patch` into `origin`:
|
|
|
```
|
|
|
git push origin
|
|
|
git push origin work-branch-patch
|
|
|
```
|
|
|
* Log into gitlab, and create a merge request based on your branch. If the branch is meant to fix an issue, you can open the merge request from the issue.
|
|
|
* Source: `work-branch-patch`
|
... | ... | @@ -39,25 +39,42 @@ git push origin |
|
|
* **Check "Remove source branch when..."**
|
|
|
|
|
|
|
|
|
### Strategy A
|
|
|
### Strategy B
|
|
|
Advised for "larger" modifications. This strategy is close to the previous one, but we synchronize regularly `work-branch-patch` with `work-branch` (i.e. when some king of important milestone has been achieved, and you want to make it visible once merged into origin)
|
|
|
|
|
|
![stratAdvanced](/uploads/47ae27cee3575bab44085435cdf5b77a/stratAdvanced.png)
|
|
|
![stratAdvanced](/uploads/0885173c94518e4651a9c4d97f264da3/stratAdvanced.png)
|
|
|
|
|
|
The usage is the same, except that:
|
|
|
* For regular sync between `work-branch-patch` and `work-branch`, use squashed merges: `git merge --squash work-branch`.
|
|
|
* For regular sync between `work-branch-patch` and `work-branch`, use squashed merges:
|
|
|
|
|
|
```
|
|
|
git checkout work-branch-patch
|
|
|
git merge --squash work-branch
|
|
|
```
|
|
|
|
|
|
* Before the last sync
|
|
|
* Update master:
|
|
|
|
|
|
```
|
|
|
git checkout master
|
|
|
git pull
|
|
|
git checkout work-branch
|
|
|
git merge master
|
|
|
```
|
|
|
|
|
|
* **RUN THE REGRESSION TESTS !!!**
|
|
|
* Sync: `git merge --squash work-branch`
|
|
|
* Push on origin:
|
|
|
* Sync:
|
|
|
|
|
|
```
|
|
|
git checkout work-branch-patch
|
|
|
git push origin
|
|
|
git merge --squash work-branch
|
|
|
```
|
|
|
|
|
|
* Push on origin:
|
|
|
|
|
|
```
|
|
|
git push origin work-branch-patch
|
|
|
```
|
|
|
|
|
|
|
|
|
|