drop-stones / titech-sysdev-2020

システム開発プロジェクト応用第一
0 stars 0 forks source link

Pull request #6

Open drop-stones opened 3 years ago

drop-stones commented 3 years ago

演習5: ブランチbr-devを切り、いくつかコミットしPull Requestを出せ

drop-stones commented 3 years ago

演習6: ブランチbr-devのPull Request上でコードにコメントし、コミットをいくつか追加し、マージせよ

drop-stones commented 3 years ago

演習7: 受講生誰かのリポジトリをForkし、手元にCloneしてremoteを確認せよ

drop-stones commented 3 years ago

演習8: Forkしたリポジトリにコミットし、リポジトリ間Pull Requestを作成せよ。
受信したPull Request上で追加コミットを促し、コミットされたらマージせよ。

drop-stones commented 3 years ago

演習9: GitやGitHubの練習をせよ

Lean Git Branchingの続き

drop-stones commented 3 years ago

Moving Work Around

  1. Git Cherry pick
    • git cherry-pick C1 C2 ...: pick commits (C1 C2 ...) and do commits them to the current branch
  2. Git Interactive rebase
    • git rebase -i commit-id
    • change commits order: cut and paste for your order
    • modify or delete commits: pick to other keywords
drop-stones commented 3 years ago

A Mixed Bag

  1. Locally stacked commits
    $ git checkout master
    $ git cherry-pick bugFix
  2. Juggling commits
    $ git rebase -i master
    $ git commit --amend
    $ git rebase -i master
    $ git checkout master
    $ git merge caption
  3. Juggling commits 2
    $ git checkout master
    $ git cherry-pick newImage
    $ git commit --amend
    $ git cherry-pick caption
  4. Git tags
    • permanent mark (different from branch)
      $ git tag <tag name> <commit id>
  5. Git describe
    • git describe <ref> outputs the latest tag form of <tag>_<numCommits>_g<hash>
drop-stones commented 3 years ago

Advanced Topic

  1. Rebasing over 9000 times

    • git rebase <upstream> <branch>: do commits of upstream, and do commits of branch
      $ git rebase master bugFix  // master -> bugFix
      $ git rebase bugFix side      // master -> bugFix -> side
      $ git rebase side another    // master -> bugFix -> side -> another
      $ git rebase another master // fast-forward: move master to another
  2. Specifying parents

    • HEAD~: 一つ前に戻る
    • HEAD~n: n個前に戻る
    • HEAD^: 一つ前の親の中の先頭要素に戻る
    • HEAD^n: 一つ前の親の中のn番目の要素に戻る
      $ git branch bugWork HEAD~^2~
  3. Branch spaghetti

    $ git rebase master one   // fast-forward: one move to master
    $ git rebase -i C1  // change commits of one
    $ git rebase master two  // fast-forward: two move to master
    $ git rebase -i C1 // change commits of two
    $ git rebase C2 three  // fast-forward: three move to C2

All Clear!!