Skip to content
Snippets Groups Projects
Commit 7c7fbd1c authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

docs: add slides for the 8th lecture

parent 8a568330
No related branches found
No related tags found
No related merge requests found
Pipeline #293874 passed
= Advanced Git + Work Practices
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Advanced Git + Work Practices
:LECTURE_NO: 8th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Overview
[.smaller-80]
- Administrative issues
- Group exercise 3
- Fixing errors with Git
- Special files
- Work practices - GitLab
- Summary
[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues
== 1st individual exercise
- most students done
- we will finalize the feedback
== Approaching Deadlines
- Torsdag, 10. oktober / 23:59
** 2nd group deliverable
- Torsdag, 14. november / 23:59
** 3rd group deliverable
== Next Lecture
* OOP principles and practices
* modular software
* REST APIs
[background-color = "#124990"]
[color = "#fff6d5"]
== Group exercise 3
- continuation of the previous 2 phases
- half of the grade
- important choices - extend functionality - vs alternative client
[background-color = "#124990"]
[color = "#fff6d5"]
== Fixing errors with Git
== Typical errors
- staging the wrong files
- wrong commit messsage
- committing the wrong file(s)
- deleting the wrong branch
- deleting the wrong commit
- committing sensitive files
== Compounding the gravity
- easier to fix before push
- more issues with shared commits
== Recommended approaches
- not pushed
** change history ok
- pushed
** fix issues and add a new commit
** revert commit with `git revert ...`
- changing history on pushed commits
** only if there is no other option
** team is small enough to manage this
== Relevant commands
- `git restore --staged <file> ...` - to unstage
- `git commit --ammend`
- `git rebase -i HEAD~n`
- `git revert <sha value>`
- `git reflog` + `git reset --hard <sha value>`
== Relevant commands - aftermath
- `git push --force-with-lease` is a safer option that will not overwrite any work on the remote branch if more commits were added to the remote branch
- `git pull .... --allow-unrelated-histories`
[background-color = "#124990"]
[color = "#fff6d5"]
== Special files
[background-color = "#124990"]
[color = "#fff6d5"]
== Git Special Files
== Overview
- .gitignore
- .mailmap
- .gitkeep
- .gitattributes
== .gitignore
- configure files to ignore
- https://git-scm.com/docs/gitignore
- https://gitignore.io
== .mailmap
- map author / committer names and emails
- https://git-scm.com/docs/gitmailmap
== .mailmap
```
# Hallvard
Hallvard Trætteberg <hal@ntnu.no> Hallvard Trætteberg <hal@ntnu.no>
Hallvard Trætteberg <hal@ntnu.no> Hallvard Traetteberg <hal@ntnu.no>
Hallvard Trætteberg <hal@ntnu.no> hal <hal@ntnu.no>
# Adrian
George Adrian Stoica <stoica@ntnu.no> George Adrian Stoica <stoica@ntnu.no>
George Adrian Stoica <stoica@ntnu.no> Adrian Stoica <stoica@ntnu.no>
```
== .gitkeep
- keep in the repository empty folders
- git keeps track of folders that have files
- not really a git special file
- widely used convention
- typically we remove the file when we add other files to the folder
== .gitattributes
- https://www.git-scm.com/docs/gitattributes
- control git attributes per path
- for example configure how EOL is handled
== .gitattributes
```
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Set linux endings for . files
.bashrc text eol=lf
.xinitrc text eol=lf
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
```
[smaller-40]
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
== Other special files
- GitLab
** .gitlab-ci.yml
** description templates
** `.gitlab/issue_templates` or
** `.gitlab/merge_request_templates`
- Eclipse Che
** devfile.yaml
[background-color = "#124990"]
[color = "#fff6d5"]
== Work practices - GitLab
== Gitlab for agile
* Issues
* Milestones
* Task lists
* Labels
* Boards
* Quick actions
== Using templates
* Issue templates
* Merge request templates
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
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