繁体   English   中英

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

[英]Your branch and origin/master have diverged

我知道其他人问过这个问题,但我想了解它的含义。我还在学习 git。

我在分支sample-tests中做了以下事情:

git checkout master - 我切换到master分支

git pull - 我这样做是为了将所有远程代码拉到我的本地,这样我就有了更新的本地代码。

我看到了这个:

` 在分支 master 你的分支和 'origin/master' 已经分道扬镳,分别有 2 和 40 个不同的提交。 (使用“git pull”将远程分支合并到你的)

所有冲突都已修复,但您仍在合并。 (使用“git commit”结束合并)

要提交的更改:

    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

未暂存的更改提交:(使用“git add...”更新将提交的内容)(使用“git checkout --...”放弃工作目录中的更改)

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

这是什么意思:在分支 master 你的分支和 'origin/master' 已经分道扬镳,分别有 2 和 40 个不同的提交。

显然我在本地 master 分支上。 这是否意味着我的本地master分支与远程master分支不一样?

我应该这样做:

git add.

git commit -m "message". 解决这个问题? 我也应该在我所在的当前主分支上这样做吗?

我解决了冲突,上演并尝试提交。 但是我认为提交没有通过 go,我认为是因为我收到以下错误。 是 cypress.json 的错误吗? prettier --write 发现的错误是什么?

`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$ 

`

好像您有 2 个本地提交和 40 个远程分支。 Git 试图解决这些差异,但它失败了,所以你现在在一些文件中存在冲突。

我会检查这两个文件:

cypress.json
cypress/support/commands.js

解决您在那里发现的任何问题,然后将它们暂存。 之后git commit

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM