Transfer code from one computer to another via Git

branch, commit, git

Solution

I would create a new branch and push it to that branch.

git branch incomplete-code
git checkout incomplete-code
git commit -a
git push origin incomplete-code

You can then clone the repo on your own computer and work on the incomplete-code branch

git clone <repo address>
git checkout incomplete-code

After your code is complete, you can merge the branch as such

git checkout develop
git merge incomplete-code

There might be various ways to do it but this is one I can think of.

Problem

I have some code I have not committed nor pushed to the branch I am working on on a local computer because the code is not working yet. However, I simply want to move that code from one computer to another without affecting the branch. How would I do so? For example, my code is on computer A, and I am working off of a branch called 'develop' which I pull and update code from. I don't want to change anything in develop but I want to move the code I have written to computer B. How would I do so? If anyone could help that'd be great. Thanks!

Original source