Skip to content
Snippets Groups Projects
Verified Commit 0f8212ea authored by Georgiana Mania's avatar Georgiana Mania Committed by Lukas Kluft
Browse files

add content for branches, best practices and remote repos

parent 6811530e
No related branches found
No related tags found
No related merge requests found
......@@ -164,33 +164,74 @@ git branch
5. check the log for the master branch
6. delete the new branch
# Best practices
(2 slides - Lukas/Georgiana)
## Best practices
- Keep commits as small as possible
- Use one branch per one functionality or bugfix
- Cleanup: delete branches after it was merged into `master`
(2 slides - Lukas/Georgiana)
## Best practices - Naming convensions
- Use **meaningful** names for branches
- `feature_<short-desc>` for a new feature
- `bugfix_<short-desc>` for a bugfix
- Use **meaningful** commit message made of a title (max 50 chars) and a body containing a detailed explanation
* name convensions for branches
* text for commit message; structure of the commit message (1 line + \n + comment)
* keep commits as small as possible
* one branch per one functionality/bugfix
* good examples
## Best practices - Good Examples
TODO
## Remote repo & dkrz GitLab
# Remote repository & dkrz GitLab
(3-4 slides - Georgiana/Lukas)
* checkout existing repository: fork vs clone; push/pull
* remote repo
* GitLab: setup authentication based on ssh keys
* add new members to a project
* merge requests
* stop lecture: do exercises
- checkout existing repository: fork vs clone; push/pull
- remote repo
- GitLab: setup authentication based on ssh keys
- add new members to a project
- merge requests
- stop lecture: do exercises
## fork vs clone
- `git clone`: download locally (`local`) the remote repository (`origin`)
- `git fork` & `git clone`: duplicate the original repository (`upstream`) under a different username (`origin`) and then download it locally (`local`)
- check the remote links
```bash
git remote -v
```
## fetch vs pull
```bash
git pull
```
=
```bash
git fetch
+
git merge
```
## GitLab merge requests
- web interface to review the code changes proposed to be merged into the main branch
- holds useful info:
- author
- reviewer
- change diff
- commits history
- gitlab pipeline status
- ...
## Take-away/Summary
(Lukas/Georgiana)
* you should use git daily!
* industry is using it as defacto standard
* always choose merge requests instead of pushing code directly to the main branch
* stop lecture: do exercises
## Misc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment