首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >git推送原始主错误:以下未跟踪的工作树文件将被合并覆盖:.DS_Store

git推送原始主错误:以下未跟踪的工作树文件将被合并覆盖:.DS_Store
EN

Stack Overflow用户
提问于 2015-03-04 02:28:56
回答 1查看 1.4K关注 0票数 0

过了一段时间,我面临着以下问题。它的修复方法是什么?我只是个新手,所以请给我一点启发。我已经尝试遵循错误中显示的命令,但没有成功。

代码语言:javascript
运行
复制
Monas-MacBook-Pro:demo mona$ git branch
* master
Monas-MacBook-Pro:demo mona$ git add .
Monas-MacBook-Pro:demo mona$ git commit -m "logo fixed"
[master 62bedf3] logo fixed
 1 file changed, 8 insertions(+), 7 deletions(-)
Monas-MacBook-Pro:demo mona$ ls
1a
Monas-MacBook-Pro:demo mona$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Monas-MacBook-Pro:demo mona$ git push origin master
To https://lamiastella@bitbucket.org/lamiastella/vldb-demo.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://lamiastella@bitbucket.org/lamiastella/vldb-demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Monas-MacBook-Pro:demo mona$ git pull origin master
From https://bitbucket.org/lamiastella/vldb-demo
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    .DS_Store
Please move or remove them before you can merge.
Aborting
Monas-MacBook-Pro:demo mona$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

Monas-MacBook-Pro:demo mona$ 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-04 02:34:26

这些是OS内部文件。一定是有人误检了他们。只需将它们移动到另一个文件夹,进行合并,移回并将.DS_Store文件夹添加到.gitignore中,您就会没事。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28845690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档