Sharing code

suggest change

To share your code you create a repository on a remote server to which you will copy your local repository.

To avoid a working tree on the server, create a bare repository. You can set that remote as upstream so other people can fetch the same history.

On the remote server:

git init --bare /path/to/repo.git

On the local machine:

git remote add origin ssh://username@server/path/to/repo.git

(Note that ssh: is just one possible way of accessing the remote repository.)

Now copy your local repository to the remote:

git push --set-upstream origin master

Adding --set-upstream (or -u) created an upstream (tracking) reference which is used by argument-less Git commands, e.g. git pull.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents