I have two git working directories. As sometimes happens, I’ve made some changes in the wrong directory and would like to move those to the other one now. That is, I would like to merge/pull the uncommitted changes from one place to the other.
In bzr I would use merge with the –uncommitted option, but I’ve been unable to find a git equivalent.
Pushing and pulling inherently works on commits, so I don’t think there’s any way to do that, specifically.
However, you could just create a temporary branch (
git checkout -b tmp), commit to that, pull it to the other repository (git pull $OTHER tmp) and then either continue from that commit, or revert HEAD to the latest commit while keeping the changes to the working tree (git reset HEAD^) and go on working on them that way.Edit: Perhaps even more importantly, however: Are you sure you want to have two separate working directories? I can see that being useful in e.g. Mercurial or SVN (I haven’t used Bazaar, so I can’t speak for it), but in Git, you would normally use branches and stashes instead.