25
Intermediary git Joachim Desroches GNU Generation 2019-03-27 Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 1 / 11

Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Intermediary git

Joachim Desroches

GNU Generation

2019-03-27

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 1 / 11

Page 2: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 2 / 11

Page 3: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Table of Contents

1 The basics

2 New stuff!

3 Conclusion

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 3 / 11

Page 4: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

The basics

One-man git

git init, git add, git commit

git status, git log, git checkout, git diff

Do NOT confuse with project management systems like MicrosoftGithub or Gitlab!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 4 / 11

Page 5: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

The basics

One-man git

git init, git add, git commit

git status, git log, git checkout, git diff

Do NOT confuse with project management systems like MicrosoftGithub or Gitlab!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 4 / 11

Page 6: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

The basics

One-man git

git init, git add, git commit

git status, git log, git checkout, git diff

Do NOT confuse with project management systems like MicrosoftGithub or Gitlab!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 4 / 11

Page 7: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

The basics

Two man team

Remember about the central server ?

git push, git pull, git merge

Conflict resolution!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 5 / 11

Page 8: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

The basics

Two man team

Remember about the central server ?

git push, git pull, git merge

Conflict resolution!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 5 / 11

Page 9: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Some more commit possibilities

git commit --amend, git add --patch

git commit --verbose, git commit -S

git bisect start/good/bad/...

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 6 / 11

Page 10: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Some more commit possibilities

git commit --amend, git add --patch

git commit --verbose, git commit -S

git bisect start/good/bad/...

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 6 / 11

Page 11: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Some more commit possibilities

git commit --amend, git add --patch

git commit --verbose, git commit -S

git bisect start/good/bad/...

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 6 / 11

Page 12: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Branches

So what is a branch ?

git branch, git checkout

master: branch, work, merge model.

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 7 / 11

Page 13: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Branches

So what is a branch ?

git branch, git checkout

master: branch, work, merge model.

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 7 / 11

Page 14: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Branches

So what is a branch ?

git branch, git checkout

master: branch, work, merge model.

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 7 / 11

Page 15: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Rebase: your complicated best friend

Moving trees around...

Avoiding Merge Commits: git rebase <branch>

Fixing the past: git rebase -i

THIS REWRITES YOUR HISTORY

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 8 / 11

Page 16: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Rebase: your complicated best friend

Moving trees around...

Avoiding Merge Commits: git rebase <branch>

Fixing the past: git rebase -i

THIS REWRITES YOUR HISTORY

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 8 / 11

Page 17: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Rebase: your complicated best friend

Moving trees around...

Avoiding Merge Commits: git rebase <branch>

Fixing the past: git rebase -i

THIS REWRITES YOUR HISTORY

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 8 / 11

Page 18: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Rebase: your complicated best friend

Moving trees around...

Avoiding Merge Commits: git rebase <branch>

Fixing the past: git rebase -i

THIS REWRITES YOUR HISTORY

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 8 / 11

Page 19: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

New work model

Remember branch, work, merge ?

Now branch, work, rebase, work, rebase, clean merge!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 9 / 11

Page 20: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

New work model

Remember branch, work, merge ?

Now branch, work, rebase, work, rebase, clean merge!

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 9 / 11

Page 21: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

New stuff!

Tig

Use the tig tool for your repos!

Beautiful history

Easy to see a file at a commit

Easy to see diffs

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 10 / 11

Page 22: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Conclusion

Conclusion

Remember man pages are your friend!

Read the Git Book: more depth and more possibilities

Most of all, use git! Practice makes perfect.

Questions ?

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 11 / 11

Page 23: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Conclusion

Conclusion

Remember man pages are your friend!

Read the Git Book: more depth and more possibilities

Most of all, use git! Practice makes perfect.

Questions ?

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 11 / 11

Page 24: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Conclusion

Conclusion

Remember man pages are your friend!

Read the Git Book: more depth and more possibilities

Most of all, use git! Practice makes perfect.

Questions ?

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 11 / 11

Page 25: Intermediary git · Do NOT confuse with project management systems like Microsoft Github or Gitlab! Joachim Desroches (GNU Generation) Intermediary git 2019-03-274/11. The basics

Conclusion

Conclusion

Remember man pages are your friend!

Read the Git Book: more depth and more possibilities

Most of all, use git! Practice makes perfect.

Questions ?

Joachim Desroches (GNU Generation) Intermediary git 2019-03-27 11 / 11