• 克隆一个全新的项目,完成新功能并且提交:
  1. git clone XXX //克隆代码库
  2. git checkout -b test //新建分支
  3. modify some files //完成修改
  4. git add . //把修改加入stage中
  5. git commit -m '' //提交修改到test分支
  6. review代码
  7. git checkout master //切换到master分支
  8. git pull //更新代码
  9. git checkout test //切换到test分支
  10. git meger master //把master分支的代码merge到test分支
  11. git push origin 分支名//把test分支的代码push到远程库
  • 目前正在test分支上面开发某个功能,但是没有完成。突然一个紧急的bug需要处理
  1. git add .
  2. git stash
  3. git checkout bugFixBranch
  4. git pull --rebase origin master
  5. fix the bug
  6. git add .
  7. git commit -m ''
  8. git push
  9. git checkout test
  10. git stash pop
  11. continue new feature's development
  • git工作流

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐