git - Saving My Committed Work and Applying it to New and Fresh Clone of Repo

38 views Asked by At

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?

1

There are 1 answers

0
eftshift0 On

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.