Yesterday, I posted a question on how to clone a Git repository from one of my machines to another, How can I \'git clone\' from another machine?.
I am now
The error message describes what has happened. More modern versions of Git refuse to update a branch via a push if that branch is checked out.
The easiest way to work between two non-bare repositories is either to
always update the repositories by pull (or fetch and merge) or, if you have to,
by pushing to a separate branch (an import branch) and then merging that branch into the master branch on the remote machine.
The reason for this restriction is that the push operation operates only on the remote Git repository, it doesn't have access to the index and working tree. So, if allowed, a push on the checked-out branch would change the HEAD to be inconsistent with the index and working tree on the remote repository.
This would make it very easy to accidentally commit a change that undoes all of the pushed changes and also makes it very difficult to distinguish between any local changes that have not been committed and differences between the new HEAD, the index and the working tree that have been caused by push moving HEAD.