Git relies on the fact that SSH allows you to execute commands on a remote server.
If you run a command like git clone tom@github.com:username/repo, what Git is doing behind the scenes is SSHing to github.com, authenticating as the tom user, and then remotely executing git upload-pack username/repo. Now your client can talk to that process on the remote server by simply reading and writing over the SSH connection.
Of course, allowing arbitrary execution of commands is unsafe, so SSH includes the ability to restrict what commands can be executed. In a very simple case, you can restrict execution to git-shell which is included with Git. All this script does is check the command that you’re trying to execute and ensure that it’s one of git upload-pack
, git receive-pack
, or git upload-archive
.
So the syntax is:
ssh git@<route> <command> <arg>
For instance:
$ ssh git@github.com "git-upload-pack username/repo.git"
$ ssh git@github.com "git-receive-pack username/repo.git"
So to answer to your question, you can't edit the code over ssh, but you can upload your changes if you know the right syntax.
Debugging
If you would like to trace which commands are sent to the git server, follow your git command by GIT_TRACE=1 i.e.:
GIT_TRACE=1 git clone git@github.com:username/repo.git
or (Git 2.3.0+):
GIT_SSH_COMMAND="ssh -vv" git clone git@github.com:username/repo.git
Or for the hardcode mode, use strace like:
strace -f -s200 -e execve git clone git@github.com:username/repo.git
Links
See also the following articles:
You can try and reverse how pull requests happen.
- Go to your fork
Issue a Pull Request
By default this will be your fork on the right (head repo) requesting to push its commits and changes to the original repo (base repo) on the left.
Click the drop down for both base repo and head repo and select each other's repos.
You want yours listed on the left (accepting changes) while the original repository is on the right (the one with changes to push). As illustrated in this image:
Send the pull request
If your fork has not had any changes, you should be able to automatically accept the merge.
If your code somehow conflicts or is not quite clean enough, then this will not work to update via the GitHub web interface and you will need grab the code and resolve any conflicts on your machine before pushing back to your fork.
Best Answer
As of 2016 February you can use the new upload files feature.
Source.