-1

Can anyone help me with this git merge error...i am kinda a bit lost here. I have been trying to fix this merging issue for two days now and reading a lot of merging but still I can't seem to figure it out. I just jump into this git last week so i am very new to git.

Here is the error file from git GUI enter image description here

Solution to my error( This is for Git GUI):

I finally get the answer to my error. Thks to @Michiel Kauw-A-Tjoe. Here is what I did...I do

Commit -> Revert changes

to all the files that inside Unstaged Changes then I do

Remote -> fetch from -> origin

then i do

Merge -> local Merge

The reason i do that is because I wanted to get the latest file before I do my own commit and because i'm using aptana there are always the .metadata files and this will cause conflict and to avoid this conflict I get the latest/updates files first then I add my changes later.

Salman S
  • 47
  • 1
  • 15
noobes
  • 161
  • 2
  • 18
  • hi @iberbeu it stated in the Git GUI `error:command failed` at the end of the first picture, stated : `Automatic merge failed, fix conflicts and then commit the result.` I don't understand what should i do? i try to look at the git mergetool but i don't know how to use that...:( thks. – noobes Mar 19 '13 at 10:47

1 Answers1

1

It looks like you're trying to check in the Eclipse metadata files and python binary files. You should probably leave them out of version control. One way to do this is by making a list of file names and extensions you don't want to track and adding them to a text file. I'd recommend at least these entries:

*.pyc
.project
.pydevproject
.settings
.metadata

You could place the file somewhere in your repository and then run the following command:

git config --global core.excludesfile <filename>.txt

This will solve the issue from the command line. If you're committing from Eclipse, you additionally need to set up the ignored files in Preferences -> Team -> Ignored Resources. There you can enter the same lines one at a time by clicking the Add Pattern... button.

  • Thank u @Michiel. Sorry to ask again how do I do the first part, yes you are right, i'm using aptana studio 3 and i'm using Git Gui to do the gitting. How do i do a version control so that I only take the project files and not the python binary and metadata. I did check on aptana under `Preferences -> Teams -> but can't get the Ignored resources` – noobes Mar 19 '13 at 10:59
  • Try to go to your repository on the command line and ignore at least the .metadata and *.pyc files as I explained above. After that, typing `git status` should only give you your project files such as `customer.html`. – Michiel Kauw-A-Tjoe Mar 19 '13 at 11:05
  • Hi @Michiel I have edited my question that I only have that selection under aptanaS 3. How do I ignored files using aptanaS 3. – noobes Mar 19 '13 at 11:06
  • Aptana provides a similar mechanism to ignore certain filenames and extensions. As far as the `pyc` files are concerned, you can try to remove them by right-clicking on your project in the project explorer and selecting `PyDev -> Remove *.pyc, *.pyo and *$py.class Files`. The binary files will be recompiled automatically. You also might need to remove the files you don't want to track from you repository if you already committed them. – Michiel Kauw-A-Tjoe Mar 19 '13 at 11:49
  • hi @Michiel I have done the .gitignore and when I update my first repo it success and ignored all the .metadata and *.pyc. and when i make changes in the repo and then go to repo1 to get the latest it took the .metadata and *.pyc file and the conflict came back. I have the .gitignore in both repo and repo1. – noobes Mar 19 '13 at 11:59
  • I finally get the answer to my error. Thks to @Michiel Kauw-A-Tjoe. Here is what I did...I do `Commit -> Revert changes` to all the files that inside `Unstaged Changes` then I do `Remote -> fetch from -> origin`then i do `Merge -> local Merge`. The reason i do that is because I wanted to get the latest file before I do my own commit and because i'm using aptana there are always the `.metadata` files and this will cause conflict and to avoid this conflict I get the latest/updates files first then I add my changes later. Thanks to all the big brain. – noobes Mar 19 '13 at 17:28