0

I have two computer's that I have for when programming. One at work and my personal laptop. I do most of my work on my computer at work but when I try to synchronize my workspace on my personal laptop I always have two files sitting in the Git staging and I will always get an error when I try to do a pull request.

Error:

Checkout conflict with files: 
target/m2e-wtp/web-resources/META-
INF/maven/package/project/pom.properties
Checkout conflict with files: 
target/m2e-wtp/web-resources/META-
INF/maven/package/project/pom.properties

Manifest.MF (index)

Manifest-Version: 1.0
Built-By: rle2016
Build-Jdk: 1.8.0_121
Created-By: Maven Integration for Eclipse

Manifest.MF (local)

Manifest-Version: 1.0
Built-By: Ryan
Build-Jdk: 1.8.0_111
Created-By: Maven Integration for Eclipse

Obviously in here the difference is the built-by and build-jdk.

pom.properties (index)

#Generated by Maven Integration for Eclipse
#Wed Jun 14 15:55:40 EDT 2017
version=0.0.1-SNAPSHOT
groupId=
m2e.projectName=Project
m2e.projectLocation=C\:\\Users\\rle2016\\git\\Project-Server
artifactId=Project

pom.properties (local)

#Generated by Maven Integration for Eclipse
#Tue Jun 27 22:52:06 EDT 2017
version=0.0.1-SNAPSHOT
groupId=
m2e.projectName=Project
m2e.projectLocation=C\:\\Users\\Ryan\\workspace\\Project
artifactId=Project

And here the project locations are different.

So what I'm wondering is should I commit both of these files before I start working on anything? What I usually do is just do "Replace with HEAD Revision" on both of the files. Because if I commit the files wouldn't I just have the same issue when I change computers? I also don't want to do a commit just for these two files. I have changed some things in the code to some generic names.

LR07
  • 147
  • 2
  • 14
  • The whole `target/` directory should be in .gitignore. They are build artifacts, not source code. – 1615903 Jun 28 '17 at 04:07
  • @1615903 Hey thanks for the response. Added to .gitignore! – LR07 Jun 28 '17 at 15:10
  • @1615903 Hey I added the folder to .gitingore. I see it in in the file as "/target/" but the pom.properties file just came up again – LR07 Jun 29 '17 at 13:39
  • gitignore only works on files that are not tracked, see here: https://stackoverflow.com/a/1274447/1615903 – 1615903 Jun 30 '17 at 05:43

1 Answers1

1

according to your question , I suppose you use eclipse , you can use a gitignore template Eclipse.gitignore , that may solve your problem .

anuo
  • 133
  • 2
  • 6
  • Hey thanks for the response. It seems like I'm unable to add these files to the ignore list – LR07 Jun 28 '17 at 15:09