Promote free/libre software on the EPFL campus
$ git status
On branch main
Your branch is up to date with 'origin/main'.
but...
```bash $ git pull error: cannot pull: You have unstaged changes. error: Please commit or stash them. ```remember to commit your changes first
NOT the thing to do: ~~git push --force~~
$ git checkout feature
$ git rebase main
// if there are conflicts, solve them and continue with:
// git rebase --continue
$ git push --force // --force is necessary here
$ git checkout feature
$ git rebase main
// if there are conflicts, solve them and continue with:
// git rebase --continue
$ git push --force
// finally create pull/merge request on github/gitlab
// the remote server merges main and feature after approval
The goal is to allow other developers to review your code before it's added to the project's main branch
live demo
Manually merge main
$ git checkout feature
$ git rebase main
// if there are conflicts, solve them and continue with:
// git rebase --continue
$ git push --force // --force is ok since on feature branch
$ git checkout main
$ git merge feature
$ git push // do NOT --force on main branch
Avoid manual merge, use pull/merge requests