I'm a little late to the party, but I believe I found something that works for me regarding this and it might for you too if your circumstances are the same or similar.
I'm working on a feature in its own branch. The branch isn't merged into master and pushed until its finished or I've made commits that I feel comfortable showing to the public. So what I do when I want to transfer non-staged changes to another computer is:
- Make a commit, with a commit message
like "
[non-commit] FOR TRANSFER ONLY
", featuring the content you want transfered.
- Login to the other computer.
Then do:
git pull ssh+git://<username>@<domain>/path/to/project/ rb:lb
The URL might differ for you if you access your repository in a different way. This will pull changes from that URL from the remote branch "rb" into the local branch "lb". Note that I have an ssh server running on my own computer, and am able to access the repository that way.
git reset HEAD^
(implies --mixed
)
This resets the HEAD to point to the state before the "[non-commit]" commit.
From git-reset(1):
"--mixed
: Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) [...]"
So you will have your changes to the files in the end, but no commits are made to master and no need for a stash.
This will however require you to git reset --hard HEAD^
in the repository in which you made the "[non-commit]", since that commit is garbage.