0

I have stashed some changes java changes using git Stash save "mystash". I had some changes i saved to a word file from a month ago. The code has been updated by others many times since then. How did i get these stashed changes ? i cut and paste entire file content from the word doc into eclipse file and i saved them. Now i want to merge these changes LOCALLY with whats truly on the git server. So i dont want anyone to see my changes yet i just want to merge it locally with whats on the server.

I tried to apply my stash and then do a git pull but it says one of my files has a conflict and i should resolve it first. I also tried after unstashing to do a git checkout . but i got the following warning:

error: path 'src/com/myfile.java' is unmerged

so to summarize what i want to do is take my changes that i saved last month and merge them with the current code base but LOCALLY. i dont want anyone else to be able to see these changes yet because i have to test the code first after such a huge merge. After i resolve the merge conflicts i want to stash these changes again so i can work on other tasks.

j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • have you commited your changes before apllying the stash? – iberbeu Oct 22 '14 at 14:47
  • there is nothing to commit. everything was up to date. – j2emanue Oct 22 '14 at 14:50
  • 1
    Your concerns about doing everything locally doesn't make any sense - anything you do with stash/merge can only occur locally. It sounds like you are getting a merge conflict - try `git mergetool` – Andrew C Oct 22 '14 at 14:56
  • Unless you did `git push`, your change is still in your local repository only. – Alex P Oct 22 '14 at 14:59
  • but what if someone asked me to do another task ? then i have to commit these changes i merged but and then push the stuff for this new task . Im not going to be able to stash my changes after the merge right ? becuase it will ask me to commit first. my friend recommended i create a local branch and do the commit in there, but not sure. – j2emanue Oct 22 '14 at 15:02
  • if you don't have a local branch where are you developing then? in master? You can and should always commit in local. Then you will be able to pull whatever you want and work in so many other features as you need – iberbeu Oct 22 '14 at 15:27
  • yes im on master. We all work off master. – j2emanue Oct 22 '14 at 15:45

0 Answers0