Git/Continuous Integration/Docker: la terna dello sviluppo moderno.
Andremo alla scoperta di Git (https://git-scm.com/), un source control che si ad
atta alle esigenze degli sviluppatori, ottimizeremo il codice passando per l'app
roccio del Continuous Integration ed in fine useremo Docker (https://www.docker.
com/) per deploy rapidi e scalabili.
Comparing Next-Generation Container Image Building ToolsAkihiro Suda
http://sched.co/EaYe
Until recently, running `docker build` against Dockerfile had been the only way to build container images.
However, lots of opensource software are being proposed as successors/alternatives to `docker build`:
- BuildKit (Moby Project / Docker)
- img (Jessica Frazelle / Microsoft)
- Buildah (Project Atomic / Red Hat)
- umoci & Orca (SUSE)
- Bazel (Google)
- OpenShift S2I (Red Hat)
Akihiro Suda compares these new tools' advantages and disadvantages.
His evaluation basis would include but not be limited to:
- Performance (Cache efficiency, Concurrency, Distributed Execution)
- Secret management, e.g. SSH and AWS keys
- Support for non-Dockerfile
- Non-root execution
- UI & UX
- Governance of the community
He also proposes a unified interface for using these tools with Kubernetes in a vendor-neutral way.
This document discusses version control systems and provides information about Git. It begins with an overview of version control and some common systems like CVS, Subversion, Mercurial and Git. It then covers the basics of local and centralized version control systems. The advantages of distributed version control systems like Git are explained. The document outlines some key advantages and disadvantages of Git. Finally, it provides instructions for basic Git operations like initializing a repository, making commits, cloning repositories and typical workflow steps.
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
I actually described in this slide how to use Gitlab with git. I explained what is git, push, pull, clone, commit etc. so, you can use this slide to learn or tech someone.
I have evidence that using git and GitHub for documentation and community doc techniques can give us 300 doc changes in a month. I’ve bet my career on these methods and I want to share with you.
Comparing Next-Generation Container Image Building ToolsAkihiro Suda
http://sched.co/EaYe
Until recently, running `docker build` against Dockerfile had been the only way to build container images.
However, lots of opensource software are being proposed as successors/alternatives to `docker build`:
- BuildKit (Moby Project / Docker)
- img (Jessica Frazelle / Microsoft)
- Buildah (Project Atomic / Red Hat)
- umoci & Orca (SUSE)
- Bazel (Google)
- OpenShift S2I (Red Hat)
Akihiro Suda compares these new tools' advantages and disadvantages.
His evaluation basis would include but not be limited to:
- Performance (Cache efficiency, Concurrency, Distributed Execution)
- Secret management, e.g. SSH and AWS keys
- Support for non-Dockerfile
- Non-root execution
- UI & UX
- Governance of the community
He also proposes a unified interface for using these tools with Kubernetes in a vendor-neutral way.
This document discusses version control systems and provides information about Git. It begins with an overview of version control and some common systems like CVS, Subversion, Mercurial and Git. It then covers the basics of local and centralized version control systems. The advantages of distributed version control systems like Git are explained. The document outlines some key advantages and disadvantages of Git. Finally, it provides instructions for basic Git operations like initializing a repository, making commits, cloning repositories and typical workflow steps.
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
I actually described in this slide how to use Gitlab with git. I explained what is git, push, pull, clone, commit etc. so, you can use this slide to learn or tech someone.
I have evidence that using git and GitHub for documentation and community doc techniques can give us 300 doc changes in a month. I’ve bet my career on these methods and I want to share with you.
This document provides an introduction to Git and GitHub. It discusses key features of Git including being a distributed version control system designed for speed and efficiency. It covers setting up Git locally and on GitHub, including configuring user information, initializing and cloning repositories, and pushing and pulling changes. The document also provides some basic Git commands and points to additional learning resources for beginners.
Breve introduzione a GIT:
. Iniziare un nuovo progetto o clonarne uno esistente
. primi commit e comandi base
. esempi di utilizzo
Autore: Valerio Radice
tag line:
Tutorial GIT ITA italiano
Introduzione a Docker e alla Dockerizzazione.
Filosofia e progettazione Docker
Comandi principali per gesitere immagini, container, volumi e reti
Dockerfile e docker-compose
Valerio Radice @ Nextre (Maggio 2017)
TAG: docker , Dockerfile , docker-compose , italian , nextre
This document summarizes a presentation given at DrupalCamp in Athens on December 12, 2010 about Git and GitHub. The presentation introduced Git as a distributed version control system designed for speed and efficiency. It explained some of Git's core concepts like snapshots, branches, merging, and its distributed nature. It also promoted GitHub as a social coding platform that improves collaboration and code hosting for both open source and private projects. The presentation aimed to help attendees learn Git for their own benefit and prepare for Drupal moving to GitHub.
Introduction to Git/Github - A beginner's guideRohit Arora
Introduction to Git/Github - A beginner's guide
Agenda:
Installing Git
Introduction to Version Control
Git Basics
Creating a new local Git repository
Cloning a Git repository
Making use of Git commit history
Reverting files to previous states
Creating a Github Repository
Adding, Committing & Pushing changes
Branching
Merging Branches
Sending Pull Requests
Conflict Resolution
and 3 Exercises
The document discusses developing applications with Pharo. It covers making a release version using a minimal Pharo image and loading only needed code. Branding is discussed, including creating a thin executable layer. Verification of applications through signing is proposed, including signing the Pharo image. Distribution options like Open Build Service are presented, which can build packages for multiple platforms. Foreign function interface is mentioned as a way to reuse external libraries.
This document provides an overview of Git and GitHub. It explains that Git is a version control system that allows users to track changes to files and code over time. GitHub is a web-based hosting service for Git repositories that adds additional features like documentation and issue tracking. The document outlines key Git concepts like commits, branches, pulling and pushing changes. It provides a quick example workflow of creating a GitHub account, making a repository, cloning it locally, making commits, and pushing changes.
Github is an online hosting service for software development and version control that allows developers to store code and documentation in online repositories. Developers can collaborate on projects by making changes to code and documentation that are tracked by the version control system Git. Git allows developers to revert files or entire projects to previous versions, compare changes over time, experiment safely, and keep a revision history of the project.
This document provides an introduction to using git for version control. It outlines three scenarios: 1) a single developer using a local repository, 2) a team of developers using a central remote repository, and 3) contributing to a software project hosted on GitHub. The document demonstrates how to initialize repositories, add and commit changes, branch, merge, resolve conflicts, push and pull from remote repositories, and set up a shared remote repository. It provides summaries of key git commands and demonstrations of workflows through examples.
Git is a version control system that allows developers to have multiple versions of codebases and easily revert changes. Github is a website that hosts git repositories on remote servers, facilitating code sharing among teams through a graphical user interface. The document provides instructions on configuring git and connecting it to Github repositories, as well as describing basic workflows for branching, merging, rebasing, and resolving conflicts when integrating changes.
Git is a version control system for tracking changes to files, while GitLab is a web-based Git repository manager with additional features. The document discusses Git and GitLab workflows including continuous integration, continuous delivery, and continuous deployment using GitLab. It also provides examples of common Git commands like add, commit, push, pull, branch, tag, and undo.
This document provides an introduction to using GitHub, including:
- How to set up a GitHub account and add the Student Developer Pack for unlimited private repositories.
- Basic terminology like repositories, commits, pushes, pulls, branches, and pull requests.
- Tutorials for managing GitHub repositories through the web interface and command line, covering tasks like cloning repositories, adding/committing/pushing files, and adding collaborators.
This document provides an overview of GitLab and discusses implementing GitLab within the Commercial Bank of Ethiopia (CBE). It describes GitLab as a self-hosted Git repository management system that allows users to privately manage code repositories. The document outlines key GitLab features like repository creation, user management, access controls, and integration with Git workflows. It recommends a single server GitLab architecture for CBE based on its reference architectures. The proposed CBE implementation would involve deploying a GitLab server authenticated via Active Directory, with an optional GitLab runner server, and various CBE teams using it for source code management, infrastructure as code, and change tracking.
This document provides a summary of Git in 10 minutes. It begins with an overview and breakdown of the content which includes explanations of what Git is, how it works, the GitHub flow, frequently used commands, confusions around undoing changes, and useful links. The body then delves into each section providing more details on Distributed version control, local vs remote operations, the GitHub flow process, example commands for undoing changes, and resources for additional learning.
Git est un logiciel de gestion de versions décentralisé qui vous permettra de gérer la vie d'un code informatique. Il permet une stratégie de backup, de gérer des versions et de stocker tout l'historique des modifications apportées à un projet informatique.
This document discusses using GitLab CI with Docker containers. It describes how to set up a GitLab Runner as a Docker container to execute jobs within Docker containers. The GitLab Runner is configured to use the Docker executor to pull custom images, link dependent services, and cache artifacts between jobs. Docker volumes and environment variables can also be configured for the Runner container.
Introduzione al Controllo di versione (in generale) e al funzionamento di Git (in particolare). Upgrade di un'altra presentazione simile nelle basi ma incentrata su SVN.
This document provides an introduction to Git and GitHub. It discusses key features of Git including being a distributed version control system designed for speed and efficiency. It covers setting up Git locally and on GitHub, including configuring user information, initializing and cloning repositories, and pushing and pulling changes. The document also provides some basic Git commands and points to additional learning resources for beginners.
Breve introduzione a GIT:
. Iniziare un nuovo progetto o clonarne uno esistente
. primi commit e comandi base
. esempi di utilizzo
Autore: Valerio Radice
tag line:
Tutorial GIT ITA italiano
Introduzione a Docker e alla Dockerizzazione.
Filosofia e progettazione Docker
Comandi principali per gesitere immagini, container, volumi e reti
Dockerfile e docker-compose
Valerio Radice @ Nextre (Maggio 2017)
TAG: docker , Dockerfile , docker-compose , italian , nextre
This document summarizes a presentation given at DrupalCamp in Athens on December 12, 2010 about Git and GitHub. The presentation introduced Git as a distributed version control system designed for speed and efficiency. It explained some of Git's core concepts like snapshots, branches, merging, and its distributed nature. It also promoted GitHub as a social coding platform that improves collaboration and code hosting for both open source and private projects. The presentation aimed to help attendees learn Git for their own benefit and prepare for Drupal moving to GitHub.
Introduction to Git/Github - A beginner's guideRohit Arora
Introduction to Git/Github - A beginner's guide
Agenda:
Installing Git
Introduction to Version Control
Git Basics
Creating a new local Git repository
Cloning a Git repository
Making use of Git commit history
Reverting files to previous states
Creating a Github Repository
Adding, Committing & Pushing changes
Branching
Merging Branches
Sending Pull Requests
Conflict Resolution
and 3 Exercises
The document discusses developing applications with Pharo. It covers making a release version using a minimal Pharo image and loading only needed code. Branding is discussed, including creating a thin executable layer. Verification of applications through signing is proposed, including signing the Pharo image. Distribution options like Open Build Service are presented, which can build packages for multiple platforms. Foreign function interface is mentioned as a way to reuse external libraries.
This document provides an overview of Git and GitHub. It explains that Git is a version control system that allows users to track changes to files and code over time. GitHub is a web-based hosting service for Git repositories that adds additional features like documentation and issue tracking. The document outlines key Git concepts like commits, branches, pulling and pushing changes. It provides a quick example workflow of creating a GitHub account, making a repository, cloning it locally, making commits, and pushing changes.
Github is an online hosting service for software development and version control that allows developers to store code and documentation in online repositories. Developers can collaborate on projects by making changes to code and documentation that are tracked by the version control system Git. Git allows developers to revert files or entire projects to previous versions, compare changes over time, experiment safely, and keep a revision history of the project.
This document provides an introduction to using git for version control. It outlines three scenarios: 1) a single developer using a local repository, 2) a team of developers using a central remote repository, and 3) contributing to a software project hosted on GitHub. The document demonstrates how to initialize repositories, add and commit changes, branch, merge, resolve conflicts, push and pull from remote repositories, and set up a shared remote repository. It provides summaries of key git commands and demonstrations of workflows through examples.
Git is a version control system that allows developers to have multiple versions of codebases and easily revert changes. Github is a website that hosts git repositories on remote servers, facilitating code sharing among teams through a graphical user interface. The document provides instructions on configuring git and connecting it to Github repositories, as well as describing basic workflows for branching, merging, rebasing, and resolving conflicts when integrating changes.
Git is a version control system for tracking changes to files, while GitLab is a web-based Git repository manager with additional features. The document discusses Git and GitLab workflows including continuous integration, continuous delivery, and continuous deployment using GitLab. It also provides examples of common Git commands like add, commit, push, pull, branch, tag, and undo.
This document provides an introduction to using GitHub, including:
- How to set up a GitHub account and add the Student Developer Pack for unlimited private repositories.
- Basic terminology like repositories, commits, pushes, pulls, branches, and pull requests.
- Tutorials for managing GitHub repositories through the web interface and command line, covering tasks like cloning repositories, adding/committing/pushing files, and adding collaborators.
This document provides an overview of GitLab and discusses implementing GitLab within the Commercial Bank of Ethiopia (CBE). It describes GitLab as a self-hosted Git repository management system that allows users to privately manage code repositories. The document outlines key GitLab features like repository creation, user management, access controls, and integration with Git workflows. It recommends a single server GitLab architecture for CBE based on its reference architectures. The proposed CBE implementation would involve deploying a GitLab server authenticated via Active Directory, with an optional GitLab runner server, and various CBE teams using it for source code management, infrastructure as code, and change tracking.
This document provides a summary of Git in 10 minutes. It begins with an overview and breakdown of the content which includes explanations of what Git is, how it works, the GitHub flow, frequently used commands, confusions around undoing changes, and useful links. The body then delves into each section providing more details on Distributed version control, local vs remote operations, the GitHub flow process, example commands for undoing changes, and resources for additional learning.
Git est un logiciel de gestion de versions décentralisé qui vous permettra de gérer la vie d'un code informatique. Il permet une stratégie de backup, de gérer des versions et de stocker tout l'historique des modifications apportées à un projet informatique.
This document discusses using GitLab CI with Docker containers. It describes how to set up a GitLab Runner as a Docker container to execute jobs within Docker containers. The GitLab Runner is configured to use the Docker executor to pull custom images, link dependent services, and cache artifacts between jobs. Docker volumes and environment variables can also be configured for the Runner container.
Introduzione al Controllo di versione (in generale) e al funzionamento di Git (in particolare). Upgrade di un'altra presentazione simile nelle basi ma incentrata su SVN.
Slide del seminario "Intro to Git" tenuto in occasione della Google Dev Fest Campania il 14 ottobre 2016. Si parlerà di come inizializzare un Repository, della configurazione per fare il primo commit e delle ramificazioni, i branch.
La nuova guida pubblicata oggi nel Centro Risorse Babel è dedicata a Git, lo strumento gratuito per organizzare e gestire versioni differenti di un software.
Git, realizzato da Linus Torvalds, creatore di Linux, è infatti un nuovo tipo di Version Control System (VCS) focalizzato sulla gestione distribuita del software.
Il TechAdvisor Roberto Polli ne spiega il funzionamento di base e le applicazioni, in una guida ricca di esempi e di esercizi.
Scaricate l'articolo per scoprire, tra tanti consigli utili, l'utilità dei branch, il funzionamento di repository remoti o la gestione di un caso di troubleshooting.
1) The document describes a scan back procedure used to analyze tracks in emulsion sheets and reconstruct interaction vertices.
2) Over 400 tracks were followed starting from 2 cosmic-ray sheets and one additional sheet, with 99 stopping points identified across 8 plates around each point.
3) Using an impact parameter method, 81 interaction vertices were successfully reconstructed, including 57 multi-track vertices and 24 kink vertices.
4) The results demonstrate the scan back procedure can be used to identify neutral hadron interaction vertices in emulsion, but the procedure needs further fine-tuning and efficiency measurement through Monte Carlo studies.
The document discusses the Cubieboard, an inexpensive single-board computer developed by Allwinner Technology. It has an ARM-based processor and costs around $49. Features include Gigabit Ethernet, HDMI output, USB ports, and expandability via GPIO pins. The Cubieboard runs Linux and is intended for use in projects like media centers, servers, sensor networks, and home automation systems. It provides an affordable platform for prototyping and development.
Git/Continuous Integration/Docker: la terna dello sviluppo moderno.
1. Git - Continuous Integration - Docker
la terna dello sviluppo moderno
Gerardo Di Iorio
@arete
2. Chi Sono
Gerardo Di Iorio
Programmatore presso
Organizzatore DevDay AV
Linux dal 1992 ( potevo utilizzare UNIX su x86)
3. Cosa è Git
Git è un software di controllo versione distribuito utilizzabile da interfaccia a riga di
comando, creato da Linus Torvalds nel 2005.
Fonte Wikipedia
Per controllo di versione intendiamo un software che ci permette di mantenere diverse versioni di uno
stesso progetto, in modo da facilitare il suo sviluppo.
● Sviluppo Distribuito
● Gestione di progetti con moltissimi file
● Merge complessi
● Gestione delle branch semplici
● Veloce
● Robusto
● ….. lo usano tutti!
4. Importanza di un VCS
“Il controllo versione ingegneristico si è sviluppato dai processi formali basati sui disegni cartacei. Le modifiche a questi documenti sono
identificate incrementando un numero o un codice associato ad essi, denominato "numero di versione", "etichetta di versione", o
semplicemente "versione", e sono etichettate con il nome della persona che ha apportato la modifica. Una semplice forma di controllo
versione, per esempio, assegna il numero 1 alla prima versione di un progetto. Quando viene apportata la prima modifica, il numero
identificativo di versione passa a 2 e così via.” fonte wikipedia
5. Importanza di un VCS
● Il codice funziona, provo ad aggiungere questa modifica
● Ho sempre lo zip di ieri
● Ho l’undo
● Commento queste due linee ??
● Potrei fare anche migliorare quest’altra funzione….
● Bug risolto da un collega
● Quale modifiche devo mantenere ?
● Non Funziona piu’ nulla !!!!
● Particolarmente urgentissimo !!
6. NO Problem!
● Ho il controllo delle modifiche
● Ho la storia di tutte le mie modifiche
● Posso ripristinare lo stato di ogni singola modifica
● Branch di sviluppo
● Posso collaborare con altre persone
8. Controllo dei Sorgenti
Centralizzato
Centralized Version Control Systems - CVCS
CVS,Subversion Perfoce
Unico repository con tutte le
informazioni e la storia del progetto.
Localmente si ha solo uno snapshot
della versione (sincronizzata)
Localmente si ha tutta la
storia del
progetto(repository)
Decentralizzato
Distribuited Version Control Systems - DVCS
Git, Mercurial, Bazzars,Darcs
Locale
VCS
RCS,Cartelle,Patch
Il progetto viene gestito con copie
locali del progetto,in modo da avere
uno storico dello sviluppo.
9. Storia di GIT
● Sviluppo del kernel (1991-2005) Patch e File Compressi
● Uso di BitKeeper (2002)
● Reverse Engineering (Telnet BitKeeper Port ->help)
● Linus Torvalds inizia lo sviluppo di Git
Caratteristiche
● Velocità
● Design semplice
● Ottimo supporto allo sviluppo non-lineare (migliaia di rami paralleli)
● Completamente distribuito
● Capacità di gestire, in modo efficiente (velocità e dimensione dei dati), progetti grandi come il kernel Linux
10. Funzionamento di GIT
● Git tiene traccia solo dei file che gli indichiamo
esplicitamente
● Un file può essere untracked o unmodified
● Applichiamo le modifiche che vogliamo aggiungere
● Spostiamo il file nella staging area
● Quando si crea un commit vengono salvate tutte le
modifiche presenti nella staging area
● Continuiamo le nostre modifiche
● Tutto ciò viene svolto in locale
11. git init
Inizializza un repository Git in locale
● Creare una directory
● >git init (inizializza il repository nella directory corrente)
● >git init <folder> (inizializza il repository nella directory <folder>)
>git config --global user.email “Gerardo Di Iorio”
>git config --global user.email “arete74@gmail.com”
12. git status
Stato del repository
● Branch corrente (default master)
● Stato del repo “avanti” o “indietro” rispetto al branch remoto
● I file modificati non ancora nella staging area
● I file nuovi non ancora tracciati I file tracciati ma rimossi o rinominati
>git status
13. git add
Aggiunge i file nella staging area
● Serve per spostare le modifiche nella staging area
● Per re a tracciare file non tracciati
● Va fatto con i file che volete siano compresi nel prossimo commit
● Se è una cartella, aggiunge i file ricorsivamente
>git add <file1> <file2> ...<filen>
14. git add
Aggiunge i file nella staging area
● >git add -a – aggiunge tutte le modifiche sui file già tracciati
● >git add -A – come sopra ma aggiunge anche i file non ancora tracciati
● git add non aggiunge le modifiche correnti alla staging area!
15. .gitignore
File con elenco di file che vogliamo esplicitamente ignorare nel repository
● Il file accetta sia nomi completi che globbing
● Supporta la negazione *.o (escludi tutti i file che finiscono con .o) !main.o
(...ma non main.o)
Best Pactrick
● Non includere i file che sono generati dal processo di build
● Utilizzare template da https://gitignore.io
16. git commit
>git commit
● Crea un commit con le modifiche nella staging area
● Di default apre un editor di testo per permettere di digitare il messaggio di
commit
● E’ possibile aggiungere il messaggio come parametro direttamente dalla cli
>git commit -m”Initial Commit”
● Linux kernel >git commit -s
Best practice
● i messaggi di commit devono avere un senso “Versione quasi stabile” ←Nope.
● I commit in Git sono velocissimi, non si pagano
● Evitare MegaCommit “Riscritta tutta la funzione A e aggiunta funzione B e migliorata
funzione C”
● Facilità successiva nell’individuare bug
17. Commit
Struttura del commit
● Ogni commit è identificato univocamente e630e1fafacccdb8008555b63724058c6c5e8918
● Ha id l’ID è generato facendo un hash (SHA1) di un po’ di “roba”
● In genere (date le proprietà degli hash) possiamo utilizzare i primi 6/8
caratteri del commit, per identificare uno specifico commit
● Puo’ avere 1 o 2 genitori (solo il primo commit non ha nessun genitore)
● I commit possono essere “taggati”, versioni,etc
Assegna il nome all’ultimo commit
>git tag <nome>
assegna il nome al commit specificato
>git tag <nome> <commit>
Crea un tag annotato, vengono riportate anche le info relative a chi ha creato il tag
>git tag -a <nome> <commit>
18. Comandi
● git rm – rimuove un file nel repository
● git rm --cached – rimuove il file dal tree ma non lo elimina
● git mv – sposta un file del repository
● git log – mostra la history dei commit
● git show <commit> – mostra uno specifico commit
● git diff – mostra il diff tra la staging area e quello lo stato corrente
● git diff --staged – mostra il diff tra l’ultimo commit e la staging area
● git reset – toglie tutto dalla staging area (le modifiche restano)
● git reset --hard <commit> – riporta tutti i file nello stato del commit
● git blame <file> – visualizza le modifiche riga per riga con il commit e autore
● git checkout <commit> -- <file1> <file2> … <fileN> riporta il singolo/i file alla
stato del commit
● git stash crea un salvataggio temporaneo dei file nella stage area
22. git branch
Quando creare una branch ?
● branch per il ramo stabile
● un branch per il ramo di sviluppo
● per introdurre nuove funzionalità, per la localizzazione
● particolarmente urgentissimo
git branch Mostra tutte le branch locali
git branch -r Mostra tutte le branch remote
git branch <branch> crea una branch
git branch -D <branch> cancella la branch
23. git merge
Quando si effettua un merge di due branch possiamo trovare due possibili casi:
1. Fast Foward
2. 3-Way Merge
24. git merge fast-forward
Nel caso in cui non sia stato fatto nessun
nuovo commit sul branch master da quando
è stato creato il branch develop.
git checkout master
git merge develop
Non viene creato un nuovo commit per il
merge. Nei merge fast forward non ci
possono essere conflitti
25. git merge 3-way (comando)
Git risale il grafo fino a trovare un parente
comune (B).Quindi, dopo aver svolto il diff
tra il parente e i 2 nodi coinvolti nel merge,
svolge il cosiddetto 3-way merge.
● Se i due commit hanno introdotto la stessa modifica nella
stessa sezione, la modifica viene introdotta
● Se i due commit hanno introdotto una modifica in una
sezione e l’altro non ha modificate quella sezione, la
modifica viene introdotta
● Se tutti e due hanno modificato in modo diverso la stessa
sezione, si viene creato un conflitto
● Risolti i conflitti, viene creato un commit di merge, e’
speciale perchè ha due puntatori ai predecessori commit
27. git rebase
Eseguiamo un rebase di feature su master
git checkout feature; git rebase master
Partendo dall’ultimo commit di master tenta di applicare, un commit alla volta,
tutti i commit che sono sul ramo feature.Si possono ottenere piu conflitti, per
commit.
Riscrive la storia della branch!!!!!
28. git rebase -i
Esegue un rebase interattivo
git rebase -i master
Viene aperto un editor, in cui vengono mostrati tutti i commit che devono essere
applicati.Per ogni singolo commit e’ possibile specificare l’azione che deve
compiere:
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# These lines can be re-ordered; they are executed from top to bottom.
29. Conflitti
Durante un merge o un rebase potrebbero esserci dei conflitti
I conflitti vengono segnalati con questa sintassi:
<<<<<<< HEAD <-Modifiche relative al branch corrente
…….
=======
……
….
>>>>>>> <commit-id> -Modifiche relative al commit del branch remoto
30. Conflitti
I conflitti possono essere risolti anche “a mano” con un editor di testo
Esistono però dei tool visuali
meld,kdiff3,...
git mergetool avvia il vostro tool di risoluzione conflitti
Dopo aver risolto i conflitti, potete continuare con il vostro merge/rebase
32. Hosting Git repository
Per condividere il nostro repository con altre persone
abbiamo bisogno di un hosting
Github - free solo per repository pubblici
Gitlab - free per repository pubblici e privati, self hosting
Bitbucket - free per repository pubblici e privati
gitea - self hosting, solo un exe
https://git.wiki.kernel.org/index.php/GitHosting lista completa
Potete condividere il vostro branch via patch (linux kernel)
git format-patch [BASE_BRANCH_NAME]:
$ git format-patch master
0001-<commit message>.patch
$ git send-email --to <your mail> ~/patches/*.patch
$ git apply 0001-<commit message>.patch
33. git remote
I repository remoti possono essere sincronizzati:
local file system,ssh,https,git
git remote add <nome> <url>
git remote add origin https://github.com/git/git.git
git remote add originssh git@github.com:git/git.git
git remote show Mostra la lista dei repo remoti
34. git push,fetch,pull
Sincronizziamo i repo remoti
git fetch origin Sincronizza il repo remoto con il locale, scarica solo le branch
e commit remoti...non viene modificata la branch locale
git pull origin Effettua il fetch, e cerca anche di fare il merge.
git push origin test:test Sincronizza la branch locale con la branc remoto.
Se la branch remota non esiste la crea
git push origin -f test:test Effettua il push forzata, nel caso che la storia del
branch remota sia differente
35. git cherry-pick
cherry-pick <commit> applica i cambiamenti
introdotti da un commit in altro branch
● Bug fix da altre branch
● Singole Implementazioni
● Test di una nuova api
● …..
36. git non solo codice
etckeeper
● e’ una collezione di script bash che consentono di tenere sotto controllo tramite un sistema di revisione distribuito
directory /etc/
● Dobbiamo ricordarci che è fondamentale mantenere per ogni file, oltre i permessi anche il proprietario ed il gruppo
nonche tutta la struttura di directory comprese quelle vuote.
git-lfs
● estensione per gestire grandi file, presenti su non sul repository locale,ma su cloud esterni,github,gilab,aws etc
Backup di filesystem
● bup
Gestione dei documenti per presentazioni scientifiche…
latex,tex….
37. Backup
Come effettuo il backup di un repo git ?
git bundle create /backup/repo --all
Rispristino
git clone /backup/repo myrepo
Creare un repository bare
git clone --bare myrepo /backup/my-repo.git
40. CI : Continuos Integration
è una pratica che si applica in contesti in cui lo sviluppo del software avviene attraverso un sistema di versioning. Consiste
nell'allineamento frequente (ovvero "molte volte al giorno") dagli ambienti di lavoro degli sviluppatori verso l'ambiente
condiviso (wikipedia)
● Travis CI
● Circle Ci
● TeamCity
● Drone.io
Effettua la build per ogni push
Effettua test per la build
Effettua il deploy in ambienti di produzione
Certezza che tutto l’ambiente e build sia replicabile
“Ma sul mio computer compila….”
43. Docker
Docker automatizza il deployment
(consegna o rilascio al cliente, con
relativa installazione e messa in
funzione o esercizio, di una
applicazione o di un sistema software
tipicamente all'interno di un sistema
informatico aziendale) di applicazioni
all'interno di container software,
fornendo un'astrazione aggiuntiva
grazie alla virtualizzazione a livello di
sistema operativo.
44. Docker
Vantaggi
● Gestione semplificata (non devo
gestire una VM)
● Prototipazione veloce e semplice
(docker hub)
● Sviluppo semplificato
● Isolamento
● Controllo di versione (ho bisogno
di mysql 5.4.x, php 6.2.1,etc)
● oltre 10000 immagini su Docker
Hub
docker run -d -p 80:80 --name
my-apache-php-app -v
"$PWD":/var/www/html php:7.0-apache
48. Risorse
Repository di esempio
Sito web devdayci.newshell.it
https://github.com/arete/devdayci.newshell.it
Sito web devday.newshell.it
https://github.com/arete/devday.newshell.it