Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Pulling in eclipse

+10 votes
How come my CSV files in my java client program creates problems/conflicts where I can't pull?
asked Oct 12, 2016 in CSC 285 (F16) by Troy Barger (100 points)

3 Answers

+1 vote
Best answer

Whenever you have changed a file (or your program has changed a file - like the CSV file), but you have not committed your changes, then GIT won't let you pull, because you'd be overwriting those changes and (potentially) losing work.

Your choices are basically these:

  1. Get your teammates to stop committing those CSV files each time they commit.  This won't help you this time, but may in the future.
  2. Commit your versions of those files, then PULL, and open up those files and manually merge any conflicts that occur, then ADD those files again to resolve the conflict.
  3. If you don't care about your local changes to the CSV files (which is likely), then you should REPLACE your CSV files with the "HEAD REVISION" (i.e., discard your changes since the last time the CSV file was committed).  You can do this by either:
    1. In Eclipse, right click on the file and choose "Replace with->Head Revision"
    2. From the command line, run git checkout -- yourfile.csv
answered Oct 15, 2016 by Forrest Stonedahl (100 points)
+2 votes
I was having the same problem too. Try committing them and then pulling. That worked for me
answered Oct 12, 2016 by Jared Haeme (100 points)
This works, but you may want to consider discarding your local changes instead of committing them... if so, see my answer instead.
+1 vote
One way Team Eagle avoids this conflict is by deleting your current CSV's before pulling. However, that is just the way our program works, and may not be universal to the whole class.

Another way to avoid this would be to uncheck your CSV files whenever you go to "push". That way, the rest of your team would not have to worry about those files conflicting with the existing CSV when they pull.
answered Oct 14, 2016 by Michael Carlson (100 points)
Note, DELETING the files may not work well for people, because the deletion itself is still considered a modification of the file by git, and could conflict with the pull operation.  See my answer instead...