Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - strange branch merge error that I am not sure how to solve

Tags:

git

git-merge

When I git status, I get this error message:

# On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 2 different commits each, respectively.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .gitignore
nothing added to commit but untracked files present (use "git add" to track)

So I can't pull or push. When I pull I get this:

macoss-MacBook-Pro-10:Marketing owner12$ git pull origin master
Password for 'https://[email protected]': 
From https://bitbucket.org/genadinik/marketing
 * 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

What can I do to resolve this? Thanks!

like image 316
Genadinik Avatar asked Feb 07 '13 06:02

Genadinik


2 Answers

rm .DS_Store
git add -A
git commit -m "Added .gitignore file"

You'll also want to expressly add .DS_Store to your .gitignore so that when .DS_Storeis inevitably created in the future, it won't get in the way of your commits.

like image 126
warrenm Avatar answered Nov 13 '22 05:11

warrenm


You probably don't care about .DS_Store. So, try to move it to .DS_Store.bak and pull again

like image 1
xvorsx Avatar answered Nov 13 '22 06:11

xvorsx