I have created a Git repository on my Desktop machine (Windows 7) with:
git init
git add
git commit -m \"added my files\"
Connecting your Local Repo. to Git Remote Server Ubuntu
Create a User in remote server and assign permission for ssh access using
ssh-keygen
in your local server and paste, its.pub
file to ssh of the remote server.
Things to do on remote Server
Server : XX.XXX.1XX.XX
Inside Putty command line
Go to location : cd ~/srv/git
srv in your root directory
Make a folder : mkdir your_file_name followed by cd inside your file inside your git folder
initialize git there : git init --bare
Done
Things to do On Local Machine
create your repository ..
initializing Git: git init
Create the remote connection : git remote add origin git@xx.xxx.xxx.xxx:/srv/git/your_file_name
git push.
Done
If you got stuck any point refer :https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server.