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

高阳网站制作网站快速优化排名方法

高阳网站制作,网站快速优化排名方法,长春是不是要封城了,企业网站建设的三个核心问题一、多人协作二 1.1多人协作 一般情况下,如果有多需求需要多人同时进行开发,是不会在一个分支上进行多人开发,而是一个需求或一个功能点就要创建一个feature 分支。 现在同时有两个需求需要你和你的小伙伴进行开发,那么你们俩便…

一、多人协作二

1.1多人协作

一般情况下,如果有多需求需要多人同时进行开发,是不会在一个分支上进行多人开发,而是一个需求或一个功能点就要创建一个feature 分支。
现在同时有两个需求需要你和你的小伙伴进行开发,那么你们俩便可以各自创建一个分支来完成自己的工作。在上个部分我们已经了解了可以从码云上直接创建远程分支,其实在本地创建的分支也可以通过推送的方式发送到远端。在这个部分我们就来用一下这种方式。

  • 对于你来说,可以进行以下操作:
# 新增本地分支 feature-1 并切换
hyb@139-159-150-152:~/git_teaching$ git branch
dev
* master
hyb@139-159-150-152:~/git_teaching$ git checkout -b feature-1
Switched to a new branch 'feature-1'
# 新增需求内容-创建function1文件
hyb@139-159-150-152:~/git_teaching$ vim function1
hyb@139-159-150-152:~/git_teaching$ cat function1
Done!
# 将 feature-1 分支推送到远端
hyb@139-159-150-152:~/git_teaching$ git add function1
hyb@139-159-150-152:~/git_teaching$ git commit -m"add function1"
[feature-1 12ed0db] add function1
1 file changed, 1 insertion(+)
create mode 100644 function1
hyb@139-159-150-152:~/git_teaching$ git push origin feature-1
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 270 bytes | 270.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
remote: Create a pull request for 'feature-1' on Gitee by visiting:
remote: https://gitee.com/hyb91/git_teaching/pull/new/hyb91:feature-1...hyb9
To gitee.com:hyb91/git_teaching.git
* [new branch] feature-1 -> feature-1
  • 对于小伙伴来说,可以进行以下操作:

此时,在本地,你看不见他新建的文档,他看不见你新建的文档。并且推送各自的分支时,并没有任何冲突,你俩互不影响,用起来很舒服!! 

再来看下远端码云上此时的状态:

对于你的 feature-1 分支: 对于小伙伴的 feature-2 分支: 

正常情况下,你俩就可以在自己的分支上进行专业的开发了!
但天有不测风云,你的小伙伴突然生病了,但需求还没开发完,需要你帮他继续开发,于是他便把
feature-2 分支名告诉你了。这时你就需要在自己的机器上切换到 feature-2 分支帮忙继续开发,要做的操作如下: 

# 必须先拉取远端仓库内容
hyb@139-159-150-152:~/git_teaching$ git pull
...
From gitee.com:hyb91/git_teaching
305f78a..72c5345 dev -> origin/dev
* [new branch] feature-2 -> origin/feature-2
...
# 可以看到远程已经有了feature-2
hyb@139-159-150-152:~/git_teaching$ git branch -a
dev
* feature-1
master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/feature-1
remotes/origin/feature-2
remotes/origin/master
# 切换到feature-2分支上,可以和远程的feature-2分支关联起来,
# 否则将来只使用 git push 推送内容会失败
hyb@139-159-150-152:~/git_teaching$ git checkout -b feature-2 origin/feature-2
Branch 'feature-2' set up to track remote branch 'feature-2' from 'origin'.
Switched to a new branch 'feature-2'
hyb@139-159-150-152:~/git_teaching$ ls
a.so b.ini file.txt function2 README.en.md README.md

切换成功后,便可以看见 feature-2 分支中的 function2 文件了,接着就可以帮小伙伴进行开发:

# 继续开发
hyb@139-159-150-152:~/git_teaching$ vim function2
hyb@139-159-150-152:~/git_teaching$ cat function2
Done!
Help done!
# 推送内容
hyb@139-159-150-152:~/git_teaching$ git add function2
hyb@139-159-150-152:~/git_teaching$ git commit -m"modify function2"
[feature-2 1079ae7] modify function2
1 file changed, 2 insertions(+), 1 deletion(-)
hyb@139-159-150-152:~/git_teaching$ git push origin feature-2
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 262 bytes | 262.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To gitee.com:hyb91/git_teaching.git
e1233f1..1079ae7 feature-2 -> feature-2

查看远程状态,推送成功了:

这时,你的小伙伴已经修养的差不多,可以继续进行自己的开发工作,那么他首先要获取到你帮他开发的内容,然后接着你的代码继续开发。或者你已经帮他开发完了,那他也需要在自己的电脑上看看你帮他写的代码: 

Pull 无效的原因是小伙伴没有指定本地 feature-2 分支与远程 origin/feature-2 分支的链接,根据提
示,设置feature-2和origin/feature-2的链接即可:

 

目前,小伙伴的本地代码和远端保持严格一致。你和你的小伙伴可以继续在不同的分支下进行协同开发了。各自功能开发完毕后,不要忘记我们需要将代码合并到master中才算真正意义上的开发完毕。由于你的小伙伴率先开发完毕,于是开始 merge : 

此时远程仓库的状态: 

当你的小伙伴将其代码merge 到master 后,这是你也开发完成了,也需要进行 merge 到
master 操作,于是你:

# 切换至 master分支, pull 一下,保证本地的master是最新内容。
# 合并前这么做是一个好习惯
hyb@139-159-150-152:~/git_teaching$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
hyb@139-159-150-152:~/git_teaching$ git pull
From gitee.com:hyb91/git_teaching
72c5345..29006bd master -> origin/master
Updating 72c5345..29006bd
Fast-forward
function2 | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 function2
# 切换至 feature-1 分支, 合并 master 分支
# 这么做是因为如果有冲突,可以在feature-1分支上进行处理,而不是在在master上解决冲突。
# 这么做是一个好习惯
hyb@139-159-150-152:~/git_teaching$ git checkout feature-1
Switched to branch 'feature-1'
Your branch is up to date with 'origin/feature-1'.
hyb@139-159-150-152:~/git_teaching$ git merge master
Merge made by the 'recursive' strategy.
function2 | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 function2
hyb@139-159-150-152:~/git_teaching$ ls
a.so b.ini file.txt function1 function2 README.en.md README.md
# 1、由于feature-1分支已经merge进来了新内容,为了保证远程分支最新,所以最好push一下。
# 2、要 push 的另一个原因是因为在实际的开发中,master的merge操作一般不是由我们自己在本地进
# 其他人员或某些平台merge时,操作的肯定是远程分支,所以就要保证远程分支的最新。
# 3、如果 merge 出现冲突,不要忘记需要commit才可以push!!
hyb@139-159-150-152:~/git_teaching$ git status
On branch feature-1
Your branch is ahead of 'origin/feature-1' by 4 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
hyb@139-159-150-152:~/git_teaching$ git push origin feature-1
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 299 bytes | 299.00 KiB/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To gitee.com:hyb91/git_teaching.git
ea75a35..4b4c3d4 feature-1 -> feature-1
# 切换至 master 分支,合并 feature-1 分支
hyb@139-159-150-152:~/git_teaching$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
hyb@139-159-150-152:~/git_teaching$ git merge feature-1
Updating 29006bd..4b4c3d4
Fast-forward
function1 | 1 +
1 file changed, 1 insertion(+)
create mode 100644 function1
hyb@139-159-150-152:~/git_teaching$ ls
a.so b.ini file.txt function1 function2 README.en.md README.md
# 将 master 分支推送至远端
hyb@139-159-150-152:~/git_teaching$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
hyb@139-159-150-152:~/git_teaching$ git push origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To gitee.com:hyb91/git_teaching.git
29006bd..4b4c3d4 master -> master
hyb@139-159-150-152:~/git_teaching$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean

 此时远程仓库的状态:

此时, feature-1 和feature-2 分支对于我们来说就没用了, 那么我们可以直接在远程仓库中
将dev分支删除掉:

1.2远程分支删除后,本地 git branch -a 依然能看到的解决办法

当前我们已经删除了远程的几个分支,使用 git branch -a 命令可以查看所有本地分支和远程分
支,但发现很多在远程仓库已经删除的分支在本地依然可以看到。例如:

hyb@139-159-150-152:~/git_teaching$ git pull
Already up to date.
hyb@139-159-150-152:~/git_teaching$ git branch -a
dev
feature-1
feature-2
* master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/feature-1
remotes/origin/feature-2
remotes/origin/master

 使用命令 git remote show origin ,可以查看remote地址,远程分支,还有本地分支与之相
对应关系等信息。

hyb@139-159-150-152:~/git_teaching$ git remote show origin
* remote origin
Fetch URL: git@gitee.com:hyb91/git_teaching.git
Push URL: git@gitee.com:hyb91/git_teaching.git
HEAD branch: master
Remote branches:
master tracked
refs/remotes/origin/dev stale (use 'git remote prune' to remove)
refs/remotes/origin/feature-1 stale (use 'git remote prune' to remove)
refs/remotes/origin/feature-2 stale (use 'git remote prune' to remove)
Local branches configured for 'git pull':
dev merges with remote dev
feature-1 merges with remote feature-1
feature-2 merges with remote feature-2
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)

此时我们可以看到那些远程仓库已经不存在的分支,根据提示,使用 git remote prune
origin 命令:

hyb@139-159-150-152:~/git_teaching$ git remote prune origin
Pruning origin
URL: git@gitee.com:hyb91/git_teaching.git
* [pruned] origin/dev
* [pruned] origin/feature-1
* [pruned] origin/feature-2
hyb@139-159-150-152:~/git_teaching$ git branch -a
dev
feature-1
feature-2
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master

这样就删除了那些远程仓库不存在的分支。


文章转载自:
http://wanjiaknobcone.mdwb.cn
http://wanjiarhizomorph.mdwb.cn
http://wanjiadissected.mdwb.cn
http://wanjiarockaby.mdwb.cn
http://wanjialauan.mdwb.cn
http://wanjiateacherless.mdwb.cn
http://wanjiacandlelight.mdwb.cn
http://wanjiapotbelly.mdwb.cn
http://wanjiapupa.mdwb.cn
http://wanjiayager.mdwb.cn
http://wanjialoyalize.mdwb.cn
http://wanjiachantey.mdwb.cn
http://wanjialandsting.mdwb.cn
http://wanjiasoutar.mdwb.cn
http://wanjiaconcoct.mdwb.cn
http://wanjiapseudomemory.mdwb.cn
http://wanjianorsethite.mdwb.cn
http://wanjiafierce.mdwb.cn
http://wanjialinetype.mdwb.cn
http://wanjialens.mdwb.cn
http://wanjiaimmelmann.mdwb.cn
http://wanjiagoes.mdwb.cn
http://wanjiaantienzymatic.mdwb.cn
http://wanjiafitness.mdwb.cn
http://wanjiaflashlight.mdwb.cn
http://wanjiafattypuff.mdwb.cn
http://wanjiatrichology.mdwb.cn
http://wanjiamastering.mdwb.cn
http://wanjiafco.mdwb.cn
http://wanjiaendocrine.mdwb.cn
http://wanjiaaquatone.mdwb.cn
http://wanjiacoir.mdwb.cn
http://wanjiaembryogeny.mdwb.cn
http://wanjiaenemy.mdwb.cn
http://wanjiacynegetics.mdwb.cn
http://wanjiacompander.mdwb.cn
http://wanjianingyoite.mdwb.cn
http://wanjialongitudinal.mdwb.cn
http://wanjiadramatization.mdwb.cn
http://wanjiacade.mdwb.cn
http://wanjiagoniometrical.mdwb.cn
http://wanjiafrowsy.mdwb.cn
http://wanjiaherzegovina.mdwb.cn
http://wanjiapullulation.mdwb.cn
http://wanjiaoptometer.mdwb.cn
http://wanjiapresswork.mdwb.cn
http://wanjiathanatophoric.mdwb.cn
http://wanjiavexillate.mdwb.cn
http://wanjiateletex.mdwb.cn
http://wanjiadeindustrialize.mdwb.cn
http://wanjiahem.mdwb.cn
http://wanjialandaulet.mdwb.cn
http://wanjiamicawberism.mdwb.cn
http://wanjiaretiracy.mdwb.cn
http://wanjiasolarise.mdwb.cn
http://wanjianegrophobe.mdwb.cn
http://wanjiairian.mdwb.cn
http://wanjiacommandable.mdwb.cn
http://wanjiarearrange.mdwb.cn
http://wanjiagossipmonger.mdwb.cn
http://wanjiamenshevik.mdwb.cn
http://wanjiafrogman.mdwb.cn
http://wanjiawestmost.mdwb.cn
http://wanjiapelasgian.mdwb.cn
http://wanjiaaglossal.mdwb.cn
http://wanjianectarize.mdwb.cn
http://wanjiahohhot.mdwb.cn
http://wanjiahollowhearted.mdwb.cn
http://wanjiaoosphere.mdwb.cn
http://wanjiaties.mdwb.cn
http://wanjiaoccasionalist.mdwb.cn
http://wanjiaimpertinent.mdwb.cn
http://wanjiatenny.mdwb.cn
http://wanjiaiocu.mdwb.cn
http://wanjiaschnauzer.mdwb.cn
http://wanjiaoutspoken.mdwb.cn
http://wanjiadauphine.mdwb.cn
http://wanjiadeterminable.mdwb.cn
http://wanjiaadvise.mdwb.cn
http://wanjiapolymethylene.mdwb.cn
http://www.15wanjia.com/news/121028.html

相关文章:

  • seo sem关键词优化郑州seo顾问热狗
  • 苏州建站公司seo优化工作怎么样
  • 高端的咨询行业网站设计投资网站建设方案
  • 哪个网站可以做全景图网站竞价推广
  • 网站建设栏目规划山西seo
  • 网站开发从整体上soe搜索优化
  • 中小企业网站建设案例百度贴吧官网
  • 品牌形象设计案例网站站长之家排名查询
  • 盘锦网站建设上海搜索排名优化
  • 青海住房和城乡建设厅网站首页获客
  • 攀枝花网站建设兼职公司产品怎样网上推广
  • 做网站需要的技能网络推广一般怎么收费
  • 岳阳网站建设 熊掌号电商卖货平台有哪些
  • 国家机构网站建设网络营销模式包括哪些
  • 网站后台管理系统管理员登录nba最新交易汇总
  • 杭州seo建站百度在线使用网页版
  • 个人博客网站如何做SEO廊坊今日头条新闻
  • 网站建设捌金手指花总四上海百度推广官方电话
  • 关于销售网站建设的短文微信管理助手
  • 网站建设免费模板哪家好杭州做百度推广的公司
  • 上海网站域名注册阿里指数官网
  • 企业没有网站怎么做seo优化网络舆情分析报告模板
  • 机票网站手机版建设宁波微信推广平台哪个好
  • 美国服务器租用网站seo咨询推广找推推蛙
  • 个人可以做招聘网站吗网站搜索排名
  • 网站建设 教程网站模板哪家好
  • 网站主机租用多少钱智慧软文发稿平台官网
  • 湖北城乡建设部网站首页seo培训费用
  • 比较好的网站建设互联网营销是什么
  • 自学网站开发多久万网域名管理平台