devio
devio

Reputation: 1169

GIT : Merge of HEAD with origin/master failed because of these files

I have this problem with my project when I pull it :

git pull https://bitbucket.org/****************/***********.git +refs/heads/master:refs/remotes/origin/master
No update
Merge Result: Failed
Merge of HEAD with origin/master failed because of these files:
C:\wamp\www\PFASymfony_project\src\PFA\SIGBundle\Resources\views\layout.html.twig

==[IDE]== 9 juin 2013 20:45:44 Pulling... finished.

How do I resolve this ?

I'm using Netbeans IDE 7.3

P.S : I'm a newbie on Git.

Upvotes: 0

Views: 9821

Answers (1)

michas
michas

Reputation: 26555

Before any interaction with a remote repository (i.e. push or pull) have a look at git status and decide what to do with those "uncommitted changes". Either commit them if they introduce useful functionality or discard them if not. - A git pull might not be able to do its job if you still have "uncommitted changes".

Remember that a git pull is actually just a combination of git fetch which updates your remote branches and git merge which combines the corresponding remote branch into your current working tree. (That's why your git error talks about a failed merge.)

If you did not commit any changes on your side a git pull is always fine and just fast-forwards your working tree to the new version. If you did any commits and no one pushed to your remote branch everything is fine, too.

The only tricky part is, if you did some commits and someone else did other commits, too. In this case those branches diverted. git fetch will fetch the other changes and git merge will try to merge them with your work. This might work if you worked at other places in the code or might cause a conflict otherwise.

Upvotes: 1

Related Questions