Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unleashing git power

SeeSaw
November 16, 2019

Unleashing git power

Sono sempre di più gli sviluppatori che usano sistemi per il controllo di versione del software e tra questi strumenti Git è diventato uno standard de-facto. Cloni, Pull(i), Commit(ti), push(i) ...niente di più semplice, vero? ...ma ti è mai capitato di aggiungere un commit sul branch sbagliato (ed ovviamente push-ato sul repository remoto)? ...o di voler correggere il tuo codice con un singolo commit preso di un branch completamente diverso (ma niente altro)? ...mai trovato intrappolato in un conflitto di merge mentre git ti trascina nella tana del bianconiglio? Niente paura, abbiamo un paio di comandi esotici che renderanno più semplice la tua vita da programmatore (e quella dei tuoi colleghi).

SeeSaw

November 16, 2019
Tweet

More Decks by SeeSaw

Other Decks in Programming

Transcript

  1. git is a free and opensource distributed version control system

    designed to handle everything from small to very large projects with speed and efficiency
  2. $> git stash Directory di lavoro e stato indice salvati:

    WIP on develop: 0f54a61 removed websocket messaging test from controller $> git status Sul branch develop Il tuo branch è aggiornato rispetto a 'origin/ develop'. non c'è nulla di cui eseguire il commit, l'albero di lavoro è pulito $> git stash list stash@{0}: WIP on develop: 0f54a61 removed websocket messaging test from controller stash@{1}: On develop: … $> git stash pop https://i.stack.imgur.com/
  3. $> git stash Directory di lavoro e stato indice salvati:

    WIP on develop: 0f54a61 removed websocket messaging test from controller $> git status Sul branch develop Il tuo branch è aggiornato rispetto a 'origin/ develop'. non c'è nulla di cui eseguire il commit, l'albero di lavoro è pulito $> git stash list stash@{0}: WIP on develop: 0f54a61 removed websocket messaging test from controller stash@{1}: On develop: … $> git stash pop https://i.stack.imgur.com/
  4. $> git stash Directory di lavoro e stato indice salvati:

    WIP on develop: 0f54a61 removed websocket messaging test from controller $> git status Sul branch develop Il tuo branch è aggiornato rispetto a 'origin/ develop'. non c'è nulla di cui eseguire il commit, l'albero di lavoro è pulito $> git stash list stash@{0}: WIP on develop: 0f54a61 removed websocket messaging test from controller stash@{1}: On develop: … $> git stash pop https://i.stack.imgur.com/
  5. $> git stash save “award winning name” $> git stash

    clear $> git stash save --keep-index PRO TIPS
  6. $> git rebase —-abort $> git rebase —-skip $> git

    rebase —-continue …after some magic happened…
  7. DON’T BE SHY commit 5c687f002f4730a428510b8c9d3155093504d2da Merge: 4f4e5fb 2d43b94 Author: Thomas

    Rossetto <[email protected]> Date: Thu Oct 3 11:51:37 2019 +0200 Merge branch 'develop' Con flicts: Gemfile Gemfile.lock app/assets/stylesheets/active_admin.scss config/environments/production.rb db/schema.rb PRO TIPS
  8. ➤Git is hard, but rocks ➤Code as documentation (for real)

    ➤Don’t merge give up & rebase ➤Developer Happiness ➤Colleague happiness TAKEAWAYS https://www.semanticmerge.com/
  9. SEESAW Corso del popolo, 57 35131 Padova - PD 049

    8594764 www.seesaw.it [email protected] @seesaw_it https://www.linkedin.com/company/seesaw-s-r-l-/ https://www.facebook.com/seesawit/