正在“中止” git 拉取一些文件后

发布于 2024-12-05 00:18:18 字数 1622 浏览 2 评论 0原文

我使用 git 进行版本控制,我试图从服务器中提取代码更改。 当我运行“git pull origin master”时,在拉取一些文件后,它显示“正在中止”。 这是怎么回事,我过去 3 个月一直在 git 上工作,但没有发生这样的事情。有什么东西被损坏了吗?

也无法“git Push”,因为所有文件都没有被拉出,

如下所示:

 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    sites/all/modules/examples/form_example/form_example_tutorial.inc
    sites/all/modules/examples/form_example/form_example_wizard.inc
    sites/all/modules/examples/image_example/image_example.info
    sites/all/modules/examples/image_example/image_example.install
    sites/all/modules/examples/image_example/image_example.module
    sites/all/modules/examples/image_example/image_example.pages.inc
    sites/all/modules/examples/image_example/image_example.test
    sites/all/modules/examples/js_example/accordion.tpl.php
    sites/all/modules/examples/js_example/css/jsweights.css
    sites/all/modules/examples/js_example/js/ajaxy.js
    sites/all/modules/examples/js_example/js/black.js
    sites/all/modules/examples/js_example/js/blue.js
    sites/all/modules/examples/js_example/js/brown.js
    sites/all/modules/examples/js_example/js/green.js
    sites/all/modules/examples/js_example/js/purple.js
    sites/all/modules/examples/js_example/js/red.js
    sites/all/modules/examples/js_example/js_example.info
    sites/all/modules/examples/js_example/js_example.module
    sites/all/modules/examples/menu_example/menu_example.info
    sites/all/modules/examples/menu_example/menu_example.module
    sites/all/modules/examples/menu_example/menu_example.tes
Aborting

I use git for versioning, I am trying to pull code changes from the server.
As i run 'git pull origin master', after pulling some files its showing me 'Aborting'.
Whats this about, I have been working on git past 3 months but no such thing happened. Is there something corrupted?

Also unable to 'git push' since all the files have not been pulled

its like:

 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    sites/all/modules/examples/form_example/form_example_tutorial.inc
    sites/all/modules/examples/form_example/form_example_wizard.inc
    sites/all/modules/examples/image_example/image_example.info
    sites/all/modules/examples/image_example/image_example.install
    sites/all/modules/examples/image_example/image_example.module
    sites/all/modules/examples/image_example/image_example.pages.inc
    sites/all/modules/examples/image_example/image_example.test
    sites/all/modules/examples/js_example/accordion.tpl.php
    sites/all/modules/examples/js_example/css/jsweights.css
    sites/all/modules/examples/js_example/js/ajaxy.js
    sites/all/modules/examples/js_example/js/black.js
    sites/all/modules/examples/js_example/js/blue.js
    sites/all/modules/examples/js_example/js/brown.js
    sites/all/modules/examples/js_example/js/green.js
    sites/all/modules/examples/js_example/js/purple.js
    sites/all/modules/examples/js_example/js/red.js
    sites/all/modules/examples/js_example/js_example.info
    sites/all/modules/examples/js_example/js_example.module
    sites/all/modules/examples/menu_example/menu_example.info
    sites/all/modules/examples/menu_example/menu_example.module
    sites/all/modules/examples/menu_example/menu_example.tes
Aborting

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

顾忌 2024-12-12 00:18:19

它列出的所有这些文件在您的本地分支中都不会被跟踪,因此如果您进行合并,您对这些文件所做的任何更改都将无法挽回地丢失。因此,git 不允许你进行合并。

要修复此问题,请从工作树中删除所有这些文件,或者添加并提交它们,具体取决于您是否要保留对它们的本地更改。

All those files it lists are untracked in your local branch, so if you do the merge, any changes you have made to those files will be irretrievably lost. Therefore, git doesn't let you do the merge.

To fix it, either delete all those files from your working tree or add and commit them, depending on if you want to keep your local changes to them or not.

围归者 2024-12-12 00:18:19

是否跟踪本地分支机构?在 .git 文件夹中,有一个配置文件:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = //cunim/Repositories/AvaPA.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "dev"]
    remote = origin
    merge = refs/heads/dev

必须有一个您所在分支的条目才能将其推回

这里是一组关于 git 的视频教程,我们发现非常有帮助

http://www.ava.co.uk/git

Is the local branch tracked? In the .git folder there is a config file:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = //cunim/Repositories/AvaPA.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "dev"]
    remote = origin
    merge = refs/heads/dev

There has to be an entry for the branch you are on for it to be pushed back

Heres a set of video tutorials on git we found very helpful

http://www.ava.co.uk/git

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文