0

I was working on some functionality on my-branch and I have to stop and move on but the work on my-branch is not completed and another developer will take it ower.

I also dont want to push my-branch work to remote yet. Just want to be able to somehow save it and send it as a zip or so to the developer so he can apply it to his fresh clone and continue working on it.

I know of git stash but that is for stashing uncommitted changes, it does not sound like something I need.

How can I do this in git?

cd491415
  • 823
  • 2
  • 14
  • 33
  • 1
    How about you commit and send the patch over the mail or something by using `git format-patch` and `git am` on the other end. – eftshift0 Nov 07 '18 at 21:06
  • Yes, that is what I meant but I never did it before. Would you mind providing steps, I am new to git. Thank you – cd491415 Nov 07 '18 at 22:17
  • If, by any chance, the reason you don't want to push to remote is along the lines of "I don't want to pollute some important branch with something I'm unsure of", maybe just create a new branch and test stuff with your coworker on it? – Romain Valeri Nov 08 '18 at 14:51

1 Answers1

0

Commit your unfinished stuff... on the comment say something like "(unfinished) blah blah". Then, run git format-patch HEAD~3 (say.... to create patches for the last 3 revisions on your current branch). Then take the .patch files generated by git and mail them. The other person has to take the 3 patches and apply them using git am.

eftshift0
  • 26,375
  • 3
  • 36
  • 60