简体   繁体   English

你的分支和起源/主人已经分歧

[英]Your branch and origin/master have diverged

I know others have asked this question but I want to understand what it means.I am still learning git.我知道其他人问过这个问题,但我想了解它的含义。我还在学习 git。

I was on the branch sample-tests I did the following:我在分支sample-tests中做了以下事情:

git checkout master - I switched to master branch git checkout master - 我切换到master分支

git pull - I did this to pull all the remote code to my local, so that I have a updated local code. git pull - 我这样做是为了将所有远程代码拉到我的本地,这样我就有了更新的本地代码。

and I see this:我看到了这个:

` On branch master Your branch and 'origin/master' have diverged, and have 2 and 40 different commits each, respectively. ` 在分支 master 你的分支和 'origin/master' 已经分道扬镳,分别有 2 和 40 个不同的提交。 (use "git pull" to merge the remote branch into yours) (使用“git pull”将远程分支合并到你的)

All conflicts fixed but you are still merging.所有冲突都已修复,但您仍在合并。 (use "git commit" to conclude merge) (使用“git commit”结束合并)

Changes to be committed:要提交的更改:

    modified:   .eslintrc.js
    modified:   README.md
    modified:   cypress.json
    modified:   cypress/integration/SaveFormTest.js
    new file:   cypress/integration/SaveFormTest_orig.js
    modified:   cypress/support/commands.js
    new file:   cypress_old.json
    new file:   cypress_original.json
    modified:   jest.config.js
    modified:   package.json
    modified:   src/App.tsx
    modified:   src/api/requests.js
    modified:   src/components/AddressInput/AddressInput.tsx
    modified:   src/components/AddressInput/constants.ts
    modified:   src/components/FileUpload/FileUpload.styles.tsx
    modified:   src/components/FileUpload/FileUpload.tsx
    modified:   src/components/FileUpload/FileUpload.types.ts
    modified:   src/components/FileUpload/constants.ts
    new file:   src/components/FileUpload/utility.ts
    modified:   src/components/FileUploadTile/FileUploadTile.js
    modified:   src/components/FileUploadTile/UploadButton/UploadButton.js
    modified:   src/components/FormFieldsGenerator/FormFieldsGenerator.styles.tsx
    modified:   src/components/FormFieldsGenerator/FormFieldsGenerator.tsx
    modified:   src/components/FormFieldsGenerator/FormFieldsGenerator.types.ts
    modified:   src/components/FormFieldsGenerator/constants.ts
    modified:   src/components/FormFieldsGenerator/utility.ts
    modified:   src/components/FormPageTemplate/FormPageTemplate.tsx
    modified:   src/components/FormPageTemplate/FormPageTemplate.types.ts
    modified:   src/components/FormPageTemplate/FormPageTemplate.validation.ts
    new file:   src/components/FormQuestionDialogue/helpers.ts
    new file:   src/components/InputFormatted/InputCurrency.tsx
    new file:   src/components/InputFormatted/InputFormatted.styles.tsx
    new file:   src/components/InputFormatted/InputFormatted.tsx
    new file:   src/components/InputFormatted/InputFormatted.types.ts
    new file:   src/components/InputFormatted/index.ts
    new file:   src/components/ResourceDropdown/ResourceDropdown.styles.tsx
    new file:   src/components/ResourceDropdown/ResourceDropdown.tsx
    new file:   src/components/ResourceDropdown/ResourceDropdown.types.ts
    new file:   src/components/ResourceDropdown/index.ts
    modified:   src/components/Table/Table.styles.tsx
    modified:   src/components/Table/Table.tsx
    modified:   src/components/Table/Table.types.ts
    modified:   src/components/TopPanel/TopPanel.js
    deleted:    src/components/TopPanel/TopPanel.test.js
    modified:   src/config/messages/en.js
    modified:   src/constants/constants.js
    modified:   src/constants/propTypes.ts
    new file:   src/containers/AgentResources/AgentResources.styles.tsx
    new file:   src/containers/AgentResources/AgentResources.tsx
    new file:   src/containers/AgentResources/index.ts
    modified:   src/containers/UserWidget/UserWidget.js
    deleted:    src/containers/UserWidget/UserWidget.test.js
    modified:   src/graphql/client.ts
    deleted:    src/graphql/errorLink.ts
    deleted:    src/graphql/httpLink.ts
    new file:   src/gra

Changes not staged for commit: (use "git add..." to update what will be committed) (use "git checkout --..." to discard changes in working directory)未暂存的更改提交:(使用“git add...”更新将提交的内容)(使用“git checkout --...”放弃工作目录中的更改)

    modified:   cypress.json
    modified:   cypress/support/commands.js`

What does this mean: On branch master Your branch and 'origin/master' have diverged, and have 2 and 40 different commits each, respectively.这是什么意思:在分支 master 你的分支和 'origin/master' 已经分道扬镳,分别有 2 和 40 个不同的提交。

Obviously I am on the local master branch.显然我在本地 master 分支上。 Does it mean that my local master branch is not the same as the remote master branch?这是否意味着我的本地master分支与远程master分支不一样?

Should I do:我应该这样做:

git add.

git commit -m "message". to resolve this?解决这个问题? Also should I be doing this on the current master branch I am on?我也应该在我所在的当前主分支上这样做吗?

I resolved the conflicts, staged and tried committing.我解决了冲突,上演并尝试提交。 However I think the commit didnt go through, I think because I am getting the following error.但是我认为提交没有通过 go,我认为是因为我收到以下错误。 Is the error in cypress.json?What is the error that prettier --write found?是 cypress.json 的错误吗? prettier --write 发现的错误是什么?

` renukaalurkar$ git commit -m "resolving errors" `renukaalurkar$ git commit -m "解决错误"

husky > pre-commit (node v12.14.1)

↓ Stashing changes... [skipped]

→ No partially staged files found...

 ❯ Running tasks...

  ❯ Running tasks for *.{js,json,css,md}
  
   ✖ prettier --write

    git add

  ✖ prettier --write found some errors. Please fix them and try 

  committing again.

.eslintrc.js 48ms

README.md 89ms

cypress.json 8ms

cypress/integration/SaveFormTest.js 58ms

cypress/integration/SaveFormTest_orig.js 23ms

 cypress/support/commands.js 20ms

 cypress_original.json 5ms

 jest.config.js 7ms

 src/api/requests.js 28ms

 src/components/FileUploadTile/FileUploadTile.js 22ms

 src/components/FileUploadTile/UploadButton/UploadButton.js 15ms

 src/components/TopPanel/TopPanel.js 37ms

 src/config/messages/en.js 11ms

 src/constants/constants.js 14ms

 src/store/user/reducers.test.js 20ms

[error] cypress_old.json: SyntaxError: Unexpected token (1:7)

[error] > 1 | b0VIM 8.1��B^.�rrenukaalurkarRenukas-

 MBP~renukaalurkar/Documents/cypress_tests_renuka/KW-Offers- 

FE/cypress.jsonutf-8

[error]     |       ^

[error]   2 | U3210#"! Utpada������w\E$������} "defau}} 

 "defaultCommandTimeout": 100000 }, 

  "test_admin_pass":${TEST_ADMIN_PASS}   "test_admin":${TEST_ADMIN}, 

 "test_tc_pass":${TEST_TC_PASS}, "test_tc":${TEST_TC},   

  "test_pass":${TEST_PASS},       "test_user":${TEST_USER},  

"password":${PASSWORD}, "user_name",    "host":"https://app.kw-

offers.master.kw-offers-dev.com/",  "env":{{

husky > pre-commit hook failed (add --no-verify to bypass)

Renukas-MacBook-Pro:KW-Offers-FE renukaalurkar$ git pull

error: You have not concluded your merge (MERGE_HEAD exists).

hint: Please, commit your changes before merging.

fatal: Exiting because of unfinished merge.

Renukas-MacBook-Pro:KW-Offers-FE renukaalurkar$ 

` `

Seems like you have 2 local commits and 40 on remote branch.好像您有 2 个本地提交和 40 个远程分支。 Git tried to resolve the differences, but it failed, so uou hav conflicts in some files now. Git 试图解决这些差异,但它失败了,所以你现在在一些文件中存在冲突。

I would check these two files:我会检查这两个文件:

cypress.json
cypress/support/commands.js

Fix any problems you find there and then stage them.解决您在那里发现的任何问题,然后将它们暂存。 After that git commit .之后git commit

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 你的分支和'origin/master'已经分歧了 - your branch and 'origin/master' have diverged 尝试合并分支时,您的分支和 'origin/master' 出现了分歧 - Your branch and 'origin/master' have diverged when trying to merge branch 您的分支机构和“来源/主服务器”已经分开,但覆盖了服务器 - Your branch and 'origin/master' have diverged but overwrite server git 修改后的 git 合并冲突 - “您的分支和 'origin/master' 已经分歧” - git merge conflict after git amend - "Your branch and 'origin/master' have diverged" 您的分支和“起源/主”已经分歧,所有冲突都已解决,但您仍在合并 - Your branch and 'origin/master' have diverged, All conflicts fixed but you are still merging Git:您的分支机构和“来源/主”已发生分歧-更新了分叉的仓库之后 - Git: Your branch and 'origin/master' have diverged - after updating forked repo git:你的分支和'origin / master'有分歧 - 如何丢弃本地提交? - git: Your branch and 'origin/master' have diverged - how to throw away local commits? git“你的分支和'origin / master'在远程回购的新克隆之后已经分歧了 - git “Your branch and 'origin/master' have diverged” after fresh clone of remote repo master 分支和 'origin/master' 已经发散了,如何' undiverge' 分支'? - master branch and 'origin/master' have diverged, how to 'undiverge' branches'? 如何修复'git-svn'分支和'origin / master'分歧 - How to fix 'git-svn' branch and 'origin/master' have diverged
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM