Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

git - Git合并:我什么都不懂(Git merge: I do not understand nothing)

I work on a Django project with git and I am lost.

(我使用git进行Django项目,但我迷路了。)

In local I have 3 branch:

(在本地我有3个分支:)

  • master

    (主)

  • feature/4

    (功能/ 4)

  • feature/6 (derived from feature/4)

    (Feature / 6(源自Feature / 4))

so my most advance branch is feature/6

(所以我最先进的分支是Feature / 6)

I would like to merge with master but I have conflicts I do not manage to resolve

(我想与大师合并,但有冲突,我无法解决)

In my remote repository (Gitlab) , I push my feature/6 branch and make a merge request.

(在我的远程存储库(Gitlab)中 ,我推送了feature / 6分支并提出了合并请求。)

But due ton conflict, I can't merge and Gitlab do not let me resolve conflict (no button available)

(但是由于存在大量冲突,我无法合并,并且Gitlab不允许我解决冲突(无可用按钮))

what should I do?

(我该怎么办?)

  ask by SLATER translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to

(你需要)

  1. git checkout master and pull all the newest changes.

    (git checkout master并拉出所有最新更改。)

  2. git checkout feature/6 and merge it with master localy.

    (git checkout feature / 6并将其与主语言环境合并。)

    If you have merge conflicts here, I suggest to install and learn basics about kdiff3.

    (如果您在此处遇到合并冲突,建议安装并学习有关kdiff3的基础知识。)

    It is a awesome superior tool to help you with merge conflicts.

    (这是一个很棒的高级工具,可以帮助您解决合并冲突。)

  3. After all local conflicts on feature/6 solved, you can switch to master and merge feature/6 with it, push to master now.

    (解决了Feature / 6上的所有本地冲突后,您可以切换到Master并将其与功能6合并,立即推送到Master。)

This is only one way how you can going.

(这只是您前进的一种方式。)

Finaly I suggest to learn some basic git workflow and commands.

(最后,我建议学习一些基本的git工作流程和命令。)

This will save you hours of time in future.

(这样可以节省您未来的时间。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...