git push origin master error: The following untracked working tree files would be overwritten by merge: .DS_Store

git push origin master error: The following untracked working tree files would be overwritten by merge: .DS_Store

我遇到以下问题已经有一段时间了。解决办法是什么?我只是git的新手,所以请多多指教。我已经尝试按照错误中显示的命令进行操作,但没有成功。

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$ 

这些是 OS X 内部文件。一定是有人误签入了。只需将它们移动到不同的文件夹,进行合并,返回并将 .DS_Store 文件夹添加到 .gitignore 就可以了。