Skip to content
- On your server:
- Install git as per the documentation related to your server
- Setup the default git user
- mkdir -p ~/.ssh && chmod 0700 ~/.ssh
- touch ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys
- Create the repository
- git init –bare ~/theNewGitRepositoryNameComesHere.git
- On your client (suppose you already have some code to push to the new repo):
- Add your public key to the /home/git/.ssh/authorized_keys file (created above) on the server
- git init
- git remote add origin git@yourServerNameComesHere.com:/home/git/theNewGitRepositoryNameComesHere.git
- git add .
- git commit -m ‘Initial commit’
- git push -u origin master