git fetch
fails because it expects to be run from within an existing git repository. As Andy Hume notes, you must first git clone
to create a local copy of an existing repo.
Further, it defines a git remote called origin
which is set to the URL that you cloned from. This is the default remote used when you type git fetch
or git pull
to retrieve new commits into your local repository, and the default destination when you git push
to push your new local commits out to a remote repository. You do not need to include ssh://[email protected]/~username/workfolder/
in your push command if that is where you cloned from.
Here are some other useful references, from http://gitready.com/: