On Thu, Oct 7, 2010 at 12:31 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 10/07/2010 10:11 AM, Jan Janak wrote:
On Thu, Oct 7, 2010 at 9:49 AM, Ovidiu Sasosas@voipembedded.com wrote:
Hello all,
Sometimes, while doing coding on my local git repo, I would like to synchronize my local repo with the remote one but without commiting my changes. Is there a way to do this in a simple and elegant matter?
The synchronization in git works by the way of transferring commit objects, so no, I don't think so.
Also, your local uncomitted modifications are kept in files that you've checked out; remote/shared repositories are usually "bare", that means they have no checked out files. All they contain is the commit object database files (normally stored under .git).
Why not git pull --rebase?
Ohh, maybe I misunderstood the question. I thought that what Ovidiu wanted to do was transfer local uncommited changes into another (remote) repository. But that may not be the case.
git pull --rebase works with commited changes. It fetches remote updates into the local repository, removes all local _commits_, applies the remote changes and then re-applies the local commits.
But, if what Ovidiu wanted to do was preserve local changes while he is pulling updates from a remote repo into the local one, then git stash might help, as other people kindly pointed out.
Sorry for the confusion.
-Jan