-1
From https://github.com/Rochet2/TrinityCore
 * branch                  transmog_3.3.5 -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
        src/server/game/Entities/Player/Player.h
Please commit your changes or stash them before you merge.
Aborting

This is my problem. I have little to none exp with git commit and I don't know what to do with this problem.

I understand that my file player.h would be overwritten I made a change to that file a few days ago.

Now I want to make another change to my server but this pops up upon using git pull.

I already tried a few things but none work and I want to understand completely what I need to do.

I would want to know and understand what to do and keep the changes in the player.h file as well.

msanford
  • 11,803
  • 11
  • 66
  • 93
Zen Chan
  • 47
  • 1
  • 7
  • 1
    Possible duplicate of [Git for beginners: The definitive practical guide](https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide) – msanford Apr 14 '19 at 18:38
  • Either commit your change and let git merge your change into upstream's changes when you pull. Or, stash your changes, then pull and reapply your change. Or, commit your change on a different branch, then pull transmog_3.3.5, and rebase your branch. There are many possibilities, and what you do depends on what you want the final state to be. – William Pursell Apr 14 '19 at 18:43

1 Answers1

2

It depends on whether you want your change or not.

If you want your changes for future, then stash the changes and after pulling the stuff from the remote, you can pop the stash

git stash
< pull and other stuff >
git stash pop

If you don't want the changes, you can either reset the repository

git reset --hard HEAD

or, you can stash your changes ( if you are unsure ), and then later discard it when you are sure that you don't want it.

git stash
< pull >
git stash drop
Harish Ganesan
  • 135
  • 1
  • 2
  • 11