Git A Life

antonio@spadial.com

Concurrent
Versions
System

It keeps track of changes

how many github accounts?

how many git once a week?

how many git everyday?

> git init

> git status

... work is done ...

> git add <file>

> git commit -m <msg>

> git status

> git log

... more work ...

> git add <file>

> git commit -m <msg>

> git log

Antonio Jesús Sánchez

Research Software Engineer

Git a Life

easier  
to

share

easier  
to

modify

how does it work?

rtfm!

https://git-scm.com/book/en/v2

let's rtfm together

snapshots

24b9da6552252987aa493b52f8696cd6d3b00373

checksums

24b9da

is enough

the three states

working
staged
archive

gas
liquid
solid

git add

working to staged

git commit

staged to repo

git checkout

repo to working

Basic toolset

  • git init
  • git add
  • git commit
  • git checkout
  • git status
  • git log

git diff

Git your own adventure

You are in a stretch dark corridor where you have learned the very basics of control versioning with git. You feel powerful but a little tired.
There's a branch a few metters before you in the corridor, you can:


Remote

We don't need github

github?

github is for git,
as

wordpress, for html

edit,
publish

& share

octocat

> git remote add

git remote

> git pull

... commit, commit, commit, commit, ...

> git push

push permissions

do you trust devs?

let it be pulled

Branches

> git branch

A branch is a pointer

> git branch <new>

> git checkout <new>

some work, commit, commit, ...

branch pointer moves with commits

Basic branching

> git branch feature1

> git checkout feature1

work, commit, commit, ...

Achtung! Alarm!

> git checkout master

> git branch hotfix

> git checkout hotfix

work, commit, commit, ...

> git checkout master

> git merge hotfix

beer!

> git checkout feature1

... keep working

> git checkout master

> git merge feature1

Conflict!

> git merge smth

Fail to merge!

Conflict area

<<<<<<<
...
=======
...
>>>>>>> 

> git add <file1> <file2>

> git commit -m "Merge branch X"

Made with Slides.com