Professor I am working with asked for my code My postdoctoral adviser has a colleague (another professor) who she collaborated with occasionally. This professor has data that I was interested in. Together with my advisor, the three of us started a project for which I did all the modeling. 

We have not finished the project yet, but the 'other professor' announced today that he will be moving to another university in the next six months or so (I am not sure exactly when). He asked me if I could share with him a copy of the source code that I wrote for the modeling and analysis of the data. I feel uncomfortable about this, since I don't know if I will be included on manuscripts, new projects, etc. that will be coming out of the current unfinished project. I talked to my postdoctoral advisor, but she is not very helpful and actually suggested to 'just give him a copy of the [source code]'. I am not against sharing code, but I am just afraid this other professor will be using (a modified version of) my code and then not include me on a any manuscript that will be resulting from the code.
You seem uncomfortable sharing interim results with  collaborators. That goes against the collaboration spirit and I implore you to share all results. In the future, don't start a collaboration with anyone who you aren't willing to share interim results with.


  I am just afraid this other professor will be using (a modified version of) my code and then not include me on a any manuscript that will be resulting from the code.


You are afraid this other professor will commit academic fraud, steal intellectual property, or both, seemingly without any basis for concern. Again, I implore you to share all results. (Although I think it is unnecessary, you could defend against this other professor by making interim results available online.)



Read the comments, they are excellent.