当前位置: 首页 > news >正文

小浣熊做单网站韩国风格网站模板

小浣熊做单网站,韩国风格网站模板,摄影工作室网站模板,国外 设计 网站前些天发现了一个巨牛的人工智能学习网站#xff0c;通俗易懂#xff0c;风趣幽默#xff0c;忍不住分享一下给大家。点击跳转到教程。 合并分支#xff0c;冲突是难免的#xff0c;在实际协作开发中我们遇到的情况错综复杂#xff0c;今天就讲两个比较重要的命令使用gi…前些天发现了一个巨牛的人工智能学习网站通俗易懂风趣幽默忍不住分享一下给大家。点击跳转到教程。 合并分支冲突是难免的在实际协作开发中我们遇到的情况错综复杂今天就讲两个比较重要的命令使用git stash 和git stash pop 试想一下1.假如我们在develop分支开发这时候突然技术经理说有个紧急修复下这修复bug之前说了需要从master稳定版本开一个分支而我们develop如果没有commit而直接切换到master会有如下提示 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git checkout master  error: Your local changes to the following files would be overwritten by checkout:      app/src/main/java/Activity.java  Please, commit your changes or stash them before you can switch branches.  Aborting    zxdeMacBook-Pro:hswallpager zs$ git branch  * develop    master  根据提示我们需要提交修改或者在切换分之前 stash 一下。而我们每次间断就要commit一次将来git log里会有很多临时提交太多了让人无法快速定位而这的确不是我们想要的那就只有stash。stash的含义就是把工作区的修改临时储藏起来等以后再恢复使用。那我们不妨一试git stash看看结局是什么样子的 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git stash  Saved working directory and index state WIP on develop: b70f2af  develop update  HEAD is now at b70f2af  develop update  先看最后一句 HEAD is now at b70f2af develop update. 还记得上一篇的分支图吧。 [plain] view plain copy *   073fc5c 合并后的修改  |\    | * b70f2af  develop update  * | 41754e3 修改  |/    因为我们上一篇master合并后develop后并没有将develop的分支和master同步因此develop分支的最新的提交记录就在b70f2af也就是工作区目前是干净的。git stash  执行后develop分支就相当于什么也没操作一样。 接着我们在执行最开始的切换到master分支看看会怎样还会不会提示上述信息 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git checkout master  Switched to branch master  Your branch is ahead of origin/master by 8 commits.    (use git push to publish your local commits)    zxdeMacBook-Pro:hswallpager zs$ git branch    develop  * master  怎么样是不是正确切换到master分支了。现在我们在新建并切换分支hotfixes-01.然后可以修复紧急bug了。然后修改提交删除hotfixes-01即可。然后我们继续切回develop分支 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git checkout develop  Switched to branch develop  zxdeMacBook-Pro:hswallpager zs$ git status  On branch develop    nothing to commit, working directory clean  这时候我们可以先把master分支的修改合并到develop操作步骤以前也学过了合并冲突等。这时候我们看会代码stash之前的代码已经看不到了。那我们怎么继续接着上述的修改恢复现场呢。这时候用到git stash pop。我们先看一下stash清单执行git stash list。 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git stash list  stash{0}: WIP on develop: b70f2af develop update  然后我们用git stash pop 恢复现场看一下结果 [plain] view plain copy zxdeMacBook-Pro:hswallpager zs$ git stash pop  On branch develop    Changes not staged for commit:    (use git add file... to update what will be committed)    (use git checkout -- file... to discard changes in working directory)        modified:   app/src/main/java/Activity.java    no changes added to commit (use git add and/or git commit -a)  Dropped refs/stash{0} (44c79bddb5c6c3848bc0de0b687cf14d4907b012)  这时候在看工作区的源代码发现已经正确恢复现场可以继续在以前基础上工作了。 2.现在另一种情况你pull最新代码但这时候你又不想重新增加commit记录这时候先git stash然后pull最后在git stash pop, 这1和2两种情况在实际开发过程中会经常用到要熟练掌握git stash的应用。 补充在我们多次使用git stash 后git栈里充满了很多未提交的代码这时候用git stash list 可以讲git 栈信息打印出来比如 git stash apply stash{1} 就代表把指定版本号为stash{1}的工作取出来。清空的话使用git stash clear。 git stash pop 和 git stash apply 的不同 apply 读取暂存区的数据通过apply后暂存区的数据依然存在。 pop 是取出最新的一次暂存数据pop后暂存区就不会存在这次数据了。 总结 git stash  #可用来暂存当前正在进行中的工作 git stash pop  #从git栈中恢复第一个。相当于git stash apply 和git stash drop git stash list   #打印git栈中的所有信息 git stash clear  #清空git栈 git stash apply stash{1}  #将你指定版本号为stash{1}的工作取出 版本分支是git区分集中式版本控制的一大优势而为了保证团队协作中顺利的开发建议大家多用分支至于具体分支的命名不必拘泥死板根据自己团队的实际情况让分支成为我们团队开发的助推器而不是拖后腿。
http://www.zqtcl.cn/news/407448/

相关文章:

  • 如何介绍自己做的网站建设三库一平台
  • 郑州网站商城建设iframe 一直网站底部
  • 1688网站怎么样百度一下你知道
  • 做电商图的设计网站蚌埠网页设计培训
  • 江苏省建设工程质量监督站网站手机网站 案例
  • 优而思 网站科技自立自强是国家强盛之基
  • 去哪里购买网站空间专门做家居的网站
  • 网站信息安全建设方案公众号网站建设
  • 网站的设计方案淘宝大数据查询平台
  • 深圳营销型网站建设 龙华信科网站项目有需要什么技术支持
  • 开源网站模板cms网店推广实训总结
  • 常见的电子商务网站有哪些建设校园门户网站信息意义
  • 象山经济开发区建设有限公司网站足球比赛直播app
  • 国外做mg动画的网站大全网站打不开 别的电脑能打开
  • 手机怎么创网站西宁企业做网站
  • 网站主机多大wordpress连接错误
  • 3d建站电商平台网站开发过程是什么
  • 优化核心系列网站wordpress下拉刷新
  • 深圳建站定制公司国外试用网站空间
  • 网站建设的原则有哪些内容建设网站的详细步骤
  • wordpress网站换字体宣传电脑的网站开发
  • 移动网站设计上机考试修改wordpress域名
  • 个体户 建设网站房子已交房 建设局网站查不到
  • 在自己的电脑建设空间网站百中搜优化软件
  • 专业房产网站建设公司wordpress导入项目
  • 网站安全建设必要性企业vi设计是什么意思
  • 建站工具有哪些社区兰州市城乡建设局网站通知公告
  • 深圳市移动端网站建设wordpress get_category_parents
  • 多用户商城(c2c)网站制作方案招聘网站如何做推广
  • 微信云网站用什么做做网站卖产品