|
|
### Basics
|
|
|
## Basics
|
|
|
If you are completely new to Git and Github, start from reading the [Git Basics](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics)
|
|
|
or maybe [A Simple Guide to Git](http://rogerdudler.github.io/git-guide/).
|
|
|
|
|
|
These are some of the terms you'll need to know:
|
|
|
1) `pull`: fetch the most recent version of the code (after you `cloned` the repository).
|
|
|
2) `add`: "stage" your changes for the commit.
|
|
|
3) `commit`: group together changes to make them final (see [below](../wiki/Git-Workflow#commits)).
|
|
|
4) `push`: send your changes on the Github repo (the `origin`).
|
|
|
You can also check the [Cheat Sheet](../wiki/Cheat-Sheet) for some quick commands.
|
|
|
|
|
|
On a bigger scale, changes to the code can be made on different `branches`,
|
|
|
which are different versions of the same project that can be `merged` into each other.
|
|
|
|
|
|
5) `checkout <name-of-branch>`: change working branch.
|
|
|
6) `merge <another-branch>`: import all the changes made in another branch (can produce `merge conflicts` when the same file has been modified in different ways: you have to resolve them in order to merge).
|
|
|
7) `pull request`: ask for your branch to be merged with the original branch (it's better if you add some `reviewers` to check that everything's ok before merging).
|
|
|
|
|
|
### Boardcore Branches
|
|
|
## Branching model
|
|
|
|
|
|
*This branching model was inspired by <http://nvie.com/posts/a-successful-git-branching-model/>.*
|
|
|
|
... | ... | @@ -36,7 +25,7 @@ To make changes to the software you should use **temporary branches**, such as: |
|
|
- `hotfix` branches: when a bug is found on the master, a branch is created to find a fix to that bug.
|
|
|
When the problem is solved, the branch will be merged with the master *and* the testing branch before being cancelled.
|
|
|
|
|
|
### Boardcore Workflow
|
|
|
### Standard Workflow
|
|
|
|
|
|
- A new feature is required (e.g. a barometer driver)
|
|
|
- A new branch called `barometer-dev` is created from `testing` (you can do it locally)
|
... | ... | @@ -61,7 +50,7 @@ python sbs -v |
|
|
- Make a `pull request` to merge the branch back into the testing branch
|
|
|
- In `testing` futher integration tests occur, and then everything is merged on the master
|
|
|
|
|
|
### Commits
|
|
|
## Commits
|
|
|
Commits are the core of your team work, because they are the way in which you communicate to the team
|
|
|
how you changed the code.
|
|
|
For this reason, you have to *think* before you commit, and try to write [good commit messages](https://github.com/erlang/otp/wiki/writing-good-commit-messages).
|
... | ... | |