0

It's been a while that I am facing the following problem. What's the fix to it? I am just a newbie in git so please be instructive. I have already tried to follow the commands shown in the error but wasn't successful.

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$ 
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
  • Please have a look at this SO article, as this topic has been discussed before: http://stackoverflow.com/questions/18393498/gitignore-all-the-ds-store-files-in-every-folder-and-subfolder – Tim Biegeleisen Mar 04 '15 at 02:41

1 Answers1

1

Those are OS X internal files. Somebody must have checked them in by mistake. Just move them to a different folder, do the merge, move back and add the .DS_Store folder to .gitignore and you should be fine.

hd1
  • 33,938
  • 5
  • 80
  • 91
  • 1
    Perhaps you could leave this as an edit or a comment on the question as opposed to my answer – hd1 Mar 04 '15 at 02:39
  • Deleted .DS_Store from all the sub folders and now it works fine. It didn't even need a merge. – Mona Jalal Mar 04 '15 at 02:42