My workflow is basically:
- Create a repo on my desktop PC
- Do some work on it and commit changes
- Clone onto my laptop
- Work on that, commit changes
Now I want to synchronise the changes with my desktop. Trying git push desktop.local:~/my-repo
will fail, because the master branch is already checked out. I know of two solutions to this:
Create a third, bare repository in another directory on my PC and update both working copies from there. But a single central repository with two working copies checked out sounds like... SVN! Except clumsier, because I can't just use
svn update
andsvn commit
to synchronise with this central repository — extra steps are required to actually update the central repo from changes committed to a working copy in Git.Push to a separate branch and merge that branch in on my desktop working copy. This isn't too bad, but...
...what I don't understand is this: if I just SSH to the desktop PC and issue git pull laptop.local:~/my-repo
, it works! It pulls the committed changes in and updates the checked out master branch, no questions asked. Why can't git push
do this itself?
So here's my question: is there a command that works the same as ssh
-ing in to my desktop PC and issuing a pull
?