Sharing code
suggest changeTo 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents