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

h5可以发在哪些平台上seo研究所

h5可以发在哪些平台上,seo研究所,怎么制作游戏视频教程,自己设计logo软件参考: https://www.jianshu.com/p/f7ed3dd0d2d8https://www.cnblogs.com/-beyond/p/9495604.html git rebase 可以帮助项目中的提交历史干净整洁!!! git rebase能够将分叉的分支重新合并。下面主要介绍它的两个使用场景&#xff…

参考:

  1. https://www.jianshu.com/p/f7ed3dd0d2d8
  2. https://www.cnblogs.com/-beyond/p/9495604.html

git rebase 可以帮助项目中的提交历史干净整洁!!!

git rebase能够将分叉的分支重新合并。下面主要介绍它的两个使用场景:

场景一:本地与远端同一分支提交历史不一致

方式一

多个人在同一个分支上协作时,出现冲突是很正常的,比如现在有一个项目由我和A一同开发。

我在修复了一个bug以后准备提交:

HowiedeiMac:ganlin howie$ git add models/paper.go
HowiedeiMac:ganlin howie$ git commit -m 'fix a bug'
[master 8b76654] fix a bug1 file changed, 3 insertions(+), 3 deletions(-)

现在准备推送到远端:

HowiedeiMac:ganlin howie$ git push origin master
To https://gitee.com/greenhn/ganlin.git! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/greenhn/ganlin.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

push失败了,说明A在我之前已经提交了,我本地master分支的提交历史已经落后远端了,需要先pull一下,与远端同步后才能push

HowiedeiMac:ganlin howie$ git pull
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 6), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From https://gitee.com/greenhn/ganlina1bc60a..b91f711  master     -> origin/master
Merge made by the 'recursive' strategy.controllers/deal_local_data.go | 14 +++++++++++---controllers/rtu_interface.go   |  8 ++++----models/instrument_type.go      |  3 +++models/rtu_interface.go        |  3 +++4 files changed, 21 insertions(+), 7 deletions(-)

pull成功,现在使用git log看下一提交历史:

HowiedeiMac:ganlin howie$ git log --oneline --graph
*   f63ecbf (HEAD -> master) Merge branch 'master' of https://gitee.com/greenhn/ganlin
|\  
| * b91f711 (origin/master, origin/HEAD) 修正bug,优化内置通道配置
* | 8b76654 fix a bug
|/  
* a1bc60a 完善日报接口
* 9f73b5e 增加内置通道设置功能
* a0d464e ...

竟然分叉了!由于我本地master的提交历史和远端的master分支的提交历史不一致,所以git为我进行了自动合并,然后生成了一个新的提交历史(f63ecbf Merge branch 'master' of)

对于部分强迫症来说这个不能接受的,不想看到分叉。

这个时候用git rebase就可以解决:

HowiedeiMac:ganlin howie$ git rebase
First, rewinding head to replay your work on top of it...
Applying: fix a bug

现在再查看一下提交历史:

HowiedeiMac:ganlin howie$ git log --oneline --graph
* 2e2b995 (HEAD -> master) fix a bug
* b91f711 (origin/master, origin/HEAD) 修正bug,优化内置通道配置
* a1bc60a 完善日报接口
* 9f73b5e 增加内置通道设置功能
* a0d464e ...

完美解决,现在再push推送到远端:

HowiedeiMac:ganlin howie$ git push origin master
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 394 bytes | 394.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Powered By Gitee.com
To https://gitee.com/greenhn/ganlin.gitb91f711..2e2b995  master -> master

再次查看提交历史:

HowiedeiMac:ganlin howie$ git log --oneline --graph
* 2e2b995 (HEAD -> master, origin/master, origin/HEAD) fix a bug
* b91f711 修正bug,优化内置通道配置
* a1bc60a 完善日报接口
* 9f73b5e 增加内置通道设置功能
* a0d464e ...

现在远端master,远端head,本地master全部统一,问题解决。

方式二

直接执行:

git pull --rebase

效果与上面是一致的,也是最近才发现,推荐使用。

场景二:不同分支之间的合并

由于老板突发奇想,要求开发一个新的功能。

先创建一个分支用于开发新功能:

git checkout -b feature
HowiedeiMac:hello howie$ git checkout -b feature
Switched to a new branch 'feature'
HowiedeiMac:hello howie$ git branch
* featuremaster

接下来修改newFunc.go,增加新的功能,并且保存提交:

vim newFunc.gogit add newFunc.gogit commit -m 'add new func'

现在查看一下提交:

HowiedeiMac:hello howie$ git log --oneline --graph
* 4f58ab8 (HEAD -> feature) add new func
* 94c134b (master) init baseHowiedeiMac:hello howie$ git branch
* featuremaster

现在新功能开发完毕,需要将它合并到主分支中。

先尝试通过merge合并:

首先切换到master分支:

git checkout master
HowiedeiMac:hello howie$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

直接合并feature分支:

git merge feature
HowiedeiMac:hello howie$ git merge feature
Auto-merging newFunc.go
CONFLICT (content): Merge conflict in newFunc.go
Automatic merge failed; fix conflicts and then commit the result.

竟然失败了,说明我两个分支之前的版本已经不同步了,需要手动合并冲突,再提交:

先查看冲突文件:git status

HowiedeiMac:hello howie$ git status
On branch master
Your branch is ahead of 'origin/master' by 7 commits.(use "git push" to publish your local commits)You have unmerged paths.(fix conflicts and run "git commit")(use "git merge --abort" to abort the merge)Unmerged paths:(use "git add <file>..." to mark resolution)both modified:   newFunc.go

打开文件,进行修改:

原文件:

func NewFunc() {
<<<<<<< HEAD
=======fmt.Println("add new func")
>>>>>>> feature
}

修改后:

func NewFunc() {fmt.Println("add new func")
}

现在通过add添加,然后commit提交:

HowiedeiMac:hello howie$ git add newFunc.goHowiedeiMac:hello howie$ git commit -m 'merge master and feature'
[master 562ec58] merge master and feature

现在再查看一下分支提交历史:

HowiedeiMac:hello howie$ git log --oneline --graph
*   562ec58 (HEAD -> master) merge master and feature
|\  
| * 4f58ab8 (feature) add new func
* | 0e80f97 do something
|/  
* 94c134b init base

虽然合并成功,但是Master已经保存了合并历史,出现开叉了!对于强迫症患者来说肯定是不能接受的。

通过rebase合并分支:

现在将版本退回到合并前,也就是回退一个版本:

git reset --hard head^
HowiedeiMac:hello howie$ git reset --hard head^
HEAD is now at 0e80f97 do somethingHowiedeiMac:hello howie$ git log --oneline --graph
* 0e80f97 (HEAD -> master) do something
* 94c134b init base

退回去了,现在是位于master分支的init base提交这里。

先切换回feature分支:

HowiedeiMac:hello howie$ git checkout feature
Switched to branch 'feature'

在feature分支上执行: git rebase master

这句命令的意思是:以master为基础,将feature分支上的修改增加到master分支上,并生成新的版本

HowiedeiMac:hello howie$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: add new func
Using index info to reconstruct a base tree...
M       newFunc.go
Falling back to patching base and 3-way merge...
Auto-merging newFunc.go
CONFLICT (content): Merge conflict in newFunc.go
error: Failed to merge in the changes.
Patch failed at 0001 add new func
hint: Use 'git am --show-current-patch' to see the failed patchResolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

失败了,原因很简单,两个分支修改个同一个文件,产生了冲突。所以先需要解决冲突:

打开冲突的文件,解决冲突:

原文件:

func NewFunc() {
<<<<<<< HEAD
=======fmt.Println("add new func")
>>>>>>> add new func
}

修改后:

func NewFunc() {fmt.Println("add new func")
}

现在通过add添加:

HowiedeiMac:hello howie$ git add newFunc.go

现在是重点之前的rebase其实只是完成了一半,由于出现冲突而终止,现在冲突解决,可以通过git rebase —continue继续完成之前的rebase操作

HowiedeiMac:hello howie$ git rebase --continue
Applying: add new func

rebase完成,再查看一下提交历史:

HowiedeiMac:hello howie$ git log --oneline --graph
* b2593e6 (HEAD -> feature) add new func
* 0e80f97 (master) do something
* 94c134b init base

提交记录已经是一条完美的直线。现在切换到主分支master,将feather分支上的提交合并过来。

git checkout mastergit merge feature
HowiedeiMac:hello howie$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 7 commits.(use "git push" to publish your local commits)HowiedeiMac:hello howie$ git merge feature
Updating 0e80f97..b2593e6
Fast-forwardnewFunc.go | 1 +1 file changed, 1 insertion(+)

再次查看一下提交历史:

HowiedeiMac:hello howie$ git log --oneline --graph
* b2593e6 (HEAD -> master, feature) add new func
* 0e80f97 do something
* 94c134b init base

问题解决,master上也是一条直线了。

最后收个尾,删除掉feature分支:

HowiedeiMac:hello howie$ git branch -d feature
Deleted branch feature (was b2593e6).
http://www.lbrq.cn/news/2691289.html

相关文章:

  • wordpress整站生成html免费二级域名分发网站
  • 网站如何合理建设seo软文营销的特点
  • bootstrap wordpress主题seo网站推广的主要目的
  • 大学班级网站建设全国各城市疫情搜索高峰进度
  • ai智能设计logo免费2022最好的百度seo
  • 公司建设网站首页网站如何在百度刷排名
  • wordpress资源博客百度爱采购关键词优化
  • 做网站 多少钱合肥网站优化技术
  • 微博内容放到wordpress徐州seo企业
  • 长沙教育信息网上海高端seo公司
  • 北京营销型网站建站公司青岛seo服务哪家好
  • 如何做网课网站搜索引擎营销的主要方式有
  • 网站界面设计套题辅导班
  • 部门网站建设的意义营销策划方案ppt
  • 新闻网站广州网络营销公司
  • 如何做自己的淘宝网站app推广拉新接单平台
  • 蚌埠建设网站公司北京seo公司有哪些
  • 万网没备案怎么做网站短视频怎么赚钱
  • 网站单页制作教程公司网站建设步骤
  • 专业网站建设品牌百度账号注销
  • 照片在线处理工具网站怎么优化搜索
  • 沈阳网红seo网络推广知识
  • 四川省住房和城乡建设局网站网站建设在线建站
  • 如何用虚拟主机做网站seo排名谁教的好
  • 南宁网站关键字优化爱站工具下载
  • 保定市网站设计怎样给自己的网站做优化
  • web网站开发工作经验培训机构排名一览表
  • 慕枫宁波网站建设推广渠道有哪些平台
  • 什么程序做教育网站好营销网站建设流程
  • decorum wordpressseo培训多少钱
  • SQL 合并两个时间段的销售数据:FULL OUTER JOIN + COALESCE
  • Flutter UI Kits by Olayemi Garuba:免费开源的高质量UI组件库
  • Python初学者笔记第二十四期 -- (面向对象编程)
  • 【Java Web 快速入门】九、事务管理
  • 从裸机到云原生:Linux 操作系统实战进阶的“四维跃迁”
  • CTO如何通过录音转写和音频降噪,提升企业远程协作效率?