Basics
A git repository is not much more than a box. You can put your code in in it (commit), you can send a copy of the content to another (remote) box (push), and you can fetch the content from another box to your own box (pull).
If your friend pushed his content to some box in the internet (like github) and you cannot access that location from your host, this box is not helpful in your case.
You have a few choices:
- Pull directly from your friends repository (The "box" he used to push to github.)
- Ask him to directly push his repository to your host.
- Set up some repository somewhere in your network. (In this case he can push to that repository and you can afterwards pull from it.)
Solution using a intermediate repository
As you are using ubuntu which already comes with ssh, maybe the easiest solution is setting up a new user on your box and create a bare repository there. Then you have a place to pull from an your friend can use that user to push to that repository.
You can do this like this:
sudo useradd -m gituser # create user
sudo -iu gituser git init --bare reponame # create repository
sudo passwd gituser # set password for user
Afterwards your friend can push to it using git push gituser@yourhost/reponame
. And you can get the pushed content with git clone gituser@yourhost/reponame
.
Solution using git-daemon
Another way is to use git-daemon on your friends host to serve his repository. In this case you can pull directly from his host. On windows type:
git daemon --base-path=PATH --export-all
where "PATH" is the local directory containing the repository. On ubuntu you can access that repository using
git clone git://friendshost/reponame
where "friendshost" is the hostname of your friends host, and "reponame" is the name of the directory containing the repository. For example if the repository is located at "C:\some\dir\repo" then "C:\some\dir" is the PATH and "repo" is the reponame.)