• AVR Freaks

Hot!Merge failed because of a dependency file .o.d with git

Author
vra
Senior Member
  • Total Posts : 142
  • Reward points : 0
  • Joined: 2014/07/14 18:35:19
  • Location: 0
  • Status: offline
2020/02/14 16:44:18 (permalink)
0

Merge failed because of a dependency file .o.d with git

Hi all, how are you?. I've a problem here with control version using with in mplabx and XC16.
 
I've made some changes to my code, tested and worked well, I'm in a branch called "pantalla" and I want to merge those changes to the branch "master", suddenly I have a message saying this: 
 

Merge with HEAD of pantalla failed. For more information see the output

 
when I go to output then I see the following message
 

git log --name-status --follow master
==[IDE]== 14-feb-2020 19:07:41 Searching - C:\Users\valery\MPLABXProjects\Menu_LCD.X... finished.
==[IDE]== 14-feb-2020 19:08:25 Merging into HEAD
git merge --no-ff pantalla
Merge Result: Failed
Merge of HEAD with pantalla failed because of these files:
C:\Users\valery\MPLABXProjects\Menu_LCD.X\build\default\production\interrup.o.d
==[IDE]== 14-feb-2020 19:08:25 Merging into HEAD finished.

 
then I open the file and I see the following content
 

build/default/production/interrup.o: \
interrup.c \
interrup.h \
globales.h

 
with interrup.h and globales.h lighted with a blue bar on the left wich means that they was modified, the problem here is that those files where excluded from the commit so I can't understand why git is giving me those problems.
 
How can this be solved?
#1

10 Replies Related Threads

    andersm
    Super Member
    • Total Posts : 2822
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: online
    Re: Merge failed because of a dependency file .o.d with git 2020/02/14 17:37:43 (permalink)
    +1 (1)
    You shouldn't add the build directories to version control.
    #2
    aschen0866
    Super Member
    • Total Posts : 4567
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/14 18:45:11 (permalink)
    0
    Use .gitignore. See this post
     
    https://www.microchip.com/forums/FindPost/999671
    #3
    vra
    Senior Member
    • Total Posts : 142
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/15 04:30:08 (permalink)
    0
    andersm
    You shouldn't add the build directories to version control.


    Like I said, they're exluded from version control, thats why I'm asking for help, they shouldn't giving me problems
    #4
    vra
    Senior Member
    • Total Posts : 142
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/15 04:39:11 (permalink)
    0
     
    my .gitignore has the complete /build folder added like shown below
     

     
    /build/
    /dist/default/production/Menu_LCD.X.production.cof

     
    Whwn I see the history of the project then I've two branches that haven't been merged to master and when I try to merge them the message of the problem with interrupt.o.d appears and doesn't let me  merge those branches
     
    I've placed manually restrictions in the .gitignore shown bellow
     

    *.o
    *o.d
    /build/
    /dist/default/production/Menu_LCD.X.production.cof

     
    and keeps giving me the same problem.
     
    so, should I make another project or is something else that I could do to solve the problem?.
    Thanks again for the help.
    post edited by vra - 2020/02/15 05:20:12
    #5
    andersm
    Super Member
    • Total Posts : 2822
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: online
    Re: Merge failed because of a dependency file .o.d with git 2020/02/15 06:43:40 (permalink)
    0
    Valerymy .gitignore has the complete /build folder added like shown below

    That doesn't mean the file causing the conflict isn't tracked by Git. It could have been added before the .gitignore file was created, or someone could have explicitly added it. If you make a fresh clone of master, are you absolutely sure there is no build folder?
    #6
    vra
    Senior Member
    • Total Posts : 142
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/15 21:58:13 (permalink)
    0
    andersm
    Valerymy .gitignore has the complete /build folder added like shown below

    That doesn't mean the file causing the conflict isn't tracked by Git. It could have been added before the .gitignore file was created, or someone could have explicitly added it. If you make a fresh clone of master, are you absolutely sure there is no build folder?


    sorry but I don't know exactly what you mean with doing a fresh clone of master, what I can tell you is that when I switch to master the .gitignore file is there with the same previous content.
    #7
    andersm
    Super Member
    • Total Posts : 2822
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: online
    Re: Merge failed because of a dependency file .o.d with git 2020/02/16 06:22:39 (permalink)
    0
    If you clone the repository to a new directory, does the new clone have the file build/default/production/interrup.o.d in it?
    #8
    moser
    Super Member
    • Total Posts : 569
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/17 01:57:10 (permalink)
    0
    Your problem is probably, that you have already committed the files in the build directory. And probably you did this both in the master and the pantalla branch. So the first thing to do is to remove those from the repository. Try following these steps:
    1. Make sure that you abort the failed merge completely.
    2. If you are allowed to commit directly to your master branch, then clean the master branch. Verify, that the interrup.o.d file does no longer exist.
    3. Commit the master branch. This should delete all relevant content in build and dist directory. You should be able to see in the commit a lot of files in those directories are going to be deleted from the repository. 
    4. Switch to your pantalla branch. Then clean it, too. This should delete all relevant content in build and dist directory. Verify, that the interrup.o.d file does no longer exist.
    5. Commit to your pantalla branch. You should be able to see in the commit a lot of files in those directories are going to be deleted from the repository.
    6. Then go back to your master branch and try your merge again. 
     
    Then, make sure your .gitignore is really correct. It still doesn't contain, what is recommended by these articles.
    https://microchipdevelope...n-control-working-with
    https://microchipdeveloper.com/faq:72
     
    It probably should more look like this:
    /YOURPROJECT.X/build/
    /YOURPROJECT.X/dist/
    /YOURPROJECT.X/nbproject/Makefile-*
    /YOURPROJECT.X/nbproject/Package-*
    /YOURPROJECT.X/nbproject/private/

     
    post edited by moser - 2020/02/17 02:42:39
    #9
    vra
    Senior Member
    • Total Posts : 142
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/18 15:43:07 (permalink)
    0
    andersm
    If you clone the repository to a new directory, does the new clone have the file build/default/production/interrup.o.d in it?


    For that time it doesn't existed in the project at least in the master branch.
    #10
    vra
    Senior Member
    • Total Posts : 142
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Merge failed because of a dependency file .o.d with git 2020/02/18 15:48:58 (permalink)
    0
    moser
    Your problem is probably, that you have already committed the files in the build directory. And probably you did this both in the master and the pantalla branch. So the first thing to do is to remove those from the repository. Try following these steps:
    1. Make sure that you abort the failed merge completely.
    2. If you are allowed to commit directly to your master branch, then clean the master branch. Verify, that the interrup.o.d file does no longer exist.
    3. Commit the master branch. This should delete all relevant content in build and dist directory. You should be able to see in the commit a lot of files in those directories are going to be deleted from the repository. 
    4. Switch to your pantalla branch. Then clean it, too. This should delete all relevant content in build and dist directory. Verify, that the interrup.o.d file does no longer exist.
    5. Commit to your pantalla branch. You should be able to see in the commit a lot of files in those directories are going to be deleted from the repository.
    6. Then go back to your master branch and try your merge again. 
     
    Then, make sure your .gitignore is really correct. It still doesn't contain, what is recommended by these articles.
    https://microchipdevelope...n-control-working-with
    https://microchipdeveloper.com/faq:72
     
    It probably should more look like this:
    /YOURPROJECT.X/build/
     
    /YOURPROJECT.X/dist/
     
    /YOURPROJECT.X/nbproject/Makefile-*
     
    /YOURPROJECT.X/nbproject/Package-*
     
    /YOURPROJECT.X/nbproject/private/

     


    Hi @Moser, thanks for all the advices because this problem teached me that I still have a lot to learn about version control.
     
    I will follow all your advices the next time that problem arises because what I did is take all my source files and header files, and after that then I created a new project what is running normally
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5