git & devopsgit history created by linus torvalds to maintain the kernel in april 2005 (15 years...
TRANSCRIPT
![Page 1: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/1.jpg)
git & devopsphil
![Page 2: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/2.jpg)
whoamiphil
experience with git: 5 years
experience with devops: a little
the internet is your best friend when you don’t have an answer
slides: https://x4m3.rocks/talks/git-devops.pdf
![Page 3: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/3.jpg)
on today’s program● git● devops
![Page 4: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/4.jpg)
wtf is git?scm: source control management
● bazaar (ubuntu)● cvs (netbsd, openbsd)● git (linux kernel, a billion projects)● mercurial (mozilla, facebook)● apache subversion (webkit)
![Page 5: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/5.jpg)
git historycreated by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!)
● fast● distributed (not centralized)● no corruptions
2 weeks to get something working
1 month later: kernel 2.6.12 released with git
https://github.com/git/git/tree/e83c5163316f89bfbde7d9ab23ca2e25604af290
![Page 6: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/6.jpg)
![Page 7: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/7.jpg)
git config~/.gitconfig
![Page 8: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/8.jpg)
gui > cli● gitg 👍● gitkraken● gitk● github desktop● vscode● jetbrains
gui is bad for you
![Page 9: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/9.jpg)
gui < cliyou learn by doing it manually
once you are comfortable with cli, move on with gui
![Page 10: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/10.jpg)
git commitcommits help you keep track of your work
regular and small commits are important to see what you’ve done
with a nice message you know what you did
useful if you need to go back in time to fix a nasty bug
![Page 11: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/11.jpg)
git commit messagefirst line: single short summary of the change
second line: blank
rest: description of the change, explain why you did that
![Page 12: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/12.jpg)
![Page 13: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/13.jpg)
git commit commandsgit commitgit commit file1 file2git commit -m <msg>git commit --amend --no-edit
![Page 14: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/14.jpg)
git back in timegit checkout <sha>git reset HEAD^git reset HEAD^ --hard
https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/
![Page 15: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/15.jpg)
git branchgit branchgit branch my-featuregit branch -D my-featuregit merge my-featuregit branch -d my-feature
https://learngitbranching.js.org/
![Page 16: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/16.jpg)
git diffgit diffgit diff master..my-featuregit diff sha..shagit diff --staged
![Page 17: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/17.jpg)
git stashgit stashgit stash popgit stash listgit stash applygit stash drop
![Page 18: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/18.jpg)
git loggit loggit show shagit blame path/to/file
![Page 19: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/19.jpg)
git pretty loghttps://raw.githubusercontent.com/x4m3/point/master/git/gitconfig
![Page 20: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/20.jpg)
git morehttps://ohshitgit.com/
https://git-scm.com/book/en/v2
if it breaks rm -rf and start again
man git
![Page 21: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/21.jpg)
on today’s program● git● devops
![Page 22: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/22.jpg)
wtf is devops?software development (dev) + information technology operations (ops)
1. coding2. building3. testing4. packaging5. releasing6. configuring7. monitoring
![Page 23: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/23.jpg)
wtf is ci/cd?Continuous Integration: make sure it builds and passes the tests
Continuous Delivery: publish easily
![Page 24: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/24.jpg)
continuous integration
![Page 25: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/25.jpg)
GitHub actionsfree for open source, 2000 minutes for free accounts
3000 minutes for pro accounts (free for epitech students)
actions triggered by events (push on branch, pull request, etc)
works with nodejs, python, c, c++, java, php, rust, android, ios, etc
![Page 26: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/26.jpg)
feedback on builds
![Page 27: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/27.jpg)
get actionsGitHub Marketplace
https://github.com/marketplace?type=actions
https://github.com/sdras/awesome-actions
![Page 28: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/28.jpg)
what can you do?● compile code● multiple architectures● different operating systems● coding style● unit tests● code statistics● security tests● package application● deploy to production● push to another repo
![Page 29: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/29.jpg)
example of workflow1. compile code2. check for epitech coding style3. run unit tests4. if everything passes push to git.epitech.eu5. send message to discord / telegram / teams
![Page 30: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/30.jpg)
let’s go custom.yml or .yaml files in .github/workflows
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
![Page 32: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/32.jpg)
example of workflow
![Page 33: git & devopsgit history created by Linus Torvalds to maintain the kernel in april 2005 (15 years ago!) fast distributed (not centralized) no corruptions](https://reader034.vdocuments.us/reader034/viewer/2022051923/60112dee69b32d2fe71d2491/html5/thumbnails/33.jpg)
let’s go1. compile code2. check for epitech coding style3. run unit tests4. if everything passes push to git.epitech.eu5. send message to discord / telegram / teams