Git 的实际应用

软件版本的重要性

  • 总得有个版本是可用的
  • 总能回到思路清晰的时候
  • 要能追溯到变更的过程
  • 多人协作避免冲突
  • 可以检查合并的代码

Git 的基本概念和功能

头脑中要有清晰图景

git 概念和命令

日常工作流程

  • git branch -d aaa/bbb/xxx
  • git clone / git pull
  • git checkout -b new-feature
  • git add ./-A
  • git commit -m “I create a new feature.”
  • git push -u origin new-feature
  • apply a pull request wait for code review.
  • if have conflict, should resolve it like this:
    • git rebase/merge master
    • resolve all conflict locally.
    • git commit -m “merge/rebase them all”
    • git push
  • remote code review and merged.
  • git checkout master.
  • git pull
  • git branch -d new-feature. —> loop to first step and run new round.