git gut finals

Влад Петров | ejiek

18.04.2024

Хвастаемся домашкой

github login

crates.io

Header сайта crates.io с кнопкой Login with GitHub

обычный log

git log

Граф

git log --graph

Наглядный граф

git log --graph --abbrev-commit --all

Красивый граф

--decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n%C(white)%s%C(reset) %C(dim green)- %an%C(reset)'

Настройки

git config --global --edit

git alias


    [alias]
      statso = status
      sattus = status
      syats = status
      tsatus = status
      s = status
    

Жизнь изменения

    flowchart LR
      wd[Working Directory]
      stage[Staging]
      repo[(Local Repository)]
      remote[(Remote Repository)]
      remote2[(Another Remote)]
      patch@{ shape: procs, animate: true, label: "Patches"}
      wd e1@--> stage
      stage e2@--> repo
      repo e3@--> wd
      repo <--> remote
      repo <--> remote2
      repo <--> patch
      e1@{ animate: true, animation: slow }
      e2@{ animate: true, animation: slow }
      e3@{ animate: true, animation: slow }
    

создаём patch

git format-patch -1 HEAD

применяем patch

git apply 0001-commit-message.patch

ssh

Secure Shell

ports

ftp 20,21
ssh 22
telnet 23

Ключи

ssh-keygen -t ed25519 -f ~/.ssh/github

[email protected]:ejiek-academy/agpu-labs.git
gh:ejiek-academy/agpu-labs

ssh config

~/.ssh/config


Host github gh
  User git
  HostName github.com
  IdentityFile ~/.ssh/github
    

Ветки

      gitGraph
        commit
        commit
        commit id: "arabic"
        branch roman
        checkout roman
        commit id: "roman"
        checkout main
    

Идеал

      gitGraph
        commit
        commit
        commit id: "arabic"
        commit id: "roman"
    

fast-forward

Merge commit

      gitGraph
        commit
        commit
        commit id: "arabic"
        branch roman
        checkout roman
        commit id: "roman"
        checkout main
        merge roman
    

Merge conflict

      gitGraph
        commit
        commit
        commit id: "arabic"
        branch roman
        checkout roman
        commit id: "roman"
        checkout main
        branch text
        checkout text
        commit id: "text"
        checkout main
        merge roman
        merge text
    

merge config


    [merge]
      conflictstyle = diff3
    

Что-то забыли

git commit --amend

Давно забыли

git rebase-i HEAD~


reword

GitHub Page

GitHub Pages

Что дальше?

  • .gitignore

Q&A