-2

I have recently started trying to use Git hub for some of my Visual Studio projects.

I seem to have somehow messed up my solution because I cannot compile due to this errror:

enter image description here

How can I correct this? and how can I prevent this from happening again?

jth41
  • 3,542
  • 8
  • 50
  • 105
  • 3
    You have a so-called conflict (file in the working copy and file in the repository have been edited independently from each other, and now git does not know how to deal with this situation). Maybe you made changes in an old version of your working copy and updated (checked out) from the repository afterwards. Read the git manual for the explanation of what "conflict" means. You have to solve the conflict manually. – JohnB Aug 14 '13 at 21:39
  • If I want to rollback to an older commit How do I find the ? – jth41 Aug 14 '13 at 21:42
  • The `git log` command. – RyPeck Aug 15 '13 at 00:17
  • Possible duplicate of [Git merge left HEAD marks in my files](http://stackoverflow.com/questions/10657315/git-merge-left-head-marks-in-my-files), [Git conflict markers](http://stackoverflow.com/questions/7901864/git-conflict-markers), and [How do I fix merge conflicts in Git?](http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-git). –  Aug 15 '13 at 02:06
  • @jth41 don't just reset your history to an earlier commit prematurely, without first figuring out how and why you got a merge conflict. Did you ***commit your code with the merge conflict markers still in it already***? If so, then doing a hard reset or a revert makes sense. ***But if the conflict hasn't been committed yet, doing a hard reset or a revert is just going to cause you to lose work unnecessarily***, when all you would need to do is to abort the merge and revert just your working copy. –  Aug 15 '13 at 02:19

2 Answers2

1

It looks like you've experienced your first conflict in a version control system. At least some VCSs like Git and SVN use what are called "conflict markers" in files where they couldn't figure out how to resolve the conflicts automatically, and require manual user conflict resolution.

I encourage you to read about how you can resolve conflicts in Git from the Basic Merge Conflicts section of the FREE online Pro Git book. You can also read about resolving conflicts in Git in these other Stack Overflow answers:

  1. Git merge left HEAD marks in my files.
  2. Git conflict markers.
  3. How do I fix merge conflicts in Git?.

I also highly encourage you to just learn more about how to use Git in general by reading chapters 1-3 and 6-6.5 of the Pro Git book. It will help you a lot with learning how to become really great at using Git.

Community
  • 1
  • 1
0

Have you tried rolling back to a previous commit? before the error started occurring?

Follow the answer in this question: How do you roll back (reset) a Git repository to a particular commit?

Community
  • 1
  • 1
Jeremy Lin
  • 400
  • 3
  • 12