I'm using git
in my project. Sometimes I need to share my modified changes with my colleagues or to different PC, but I don't want to push those changes. He will take my code and modify something and then will push that code.
For now I manually give him file via mail or send in pen drive. I want this to be done via git
.
Can I do like git commit
and then share without git push
?
You can save the changes to a patch file with
git diff > /path/to/file.patch
This supposes that your changes are unstaged. Use git diff --cached
if they are staged. I would not commit them, since your colleague is going to do that and you'll run into conflicts otherwise.
You can send this file via mail or whatever, and your colleague can apply those changes with
git apply /path/to/file.patch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With