{"id":1883,"date":"2013-09-21T20:17:30","date_gmt":"2013-09-21T16:17:30","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=1883"},"modified":"2013-09-21T20:17:30","modified_gmt":"2013-09-21T16:17:30","slug":"setting-git-server-on-vps","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2013\/setting-git-server-on-vps\/","title":{"rendered":"Setting Git server on VPS"},"content":{"rendered":"<p>Previously, I had set up a <a href=\"https:\/\/nayarweb.com\/blog\/2013\/finally-succeeded-in-setting-up-a-git-server\/\">git server on my laptop<\/a>. My friends would access it using my always changing IP. Furthermore, my laptop has to remain online.<\/p>\n<p>Setting up a vps as git server<br \/>\nFirst create a git user<br \/>\n<code>$sudo adduser git<\/code><\/p>\n<p>A user and a group git would be created<\/p>\n<p>Create accounts for your collaborators too using the same commands<br \/>\n<code>$ sudo adduser rambo<br \/>\n$ sudo adduser rofler<\/code><\/p>\n<p>Creating a group for the peeps working on a specific project.<br \/>\n$ sudo addgroup kuyon<\/p>\n<p>Adding the collaborators to the group kuyon<br \/>\n<code>$ sudo adduser rambo kuyon<br \/>\n$ sudo adduser rofler kuyon<\/code><\/p>\n<p>Create a directory for each project you are working. By convention, it should end with .git<\/p>\n<p><code>$ sudo mkdir \/git\/meraproject.git<br \/>\n$ sudo git init --bare<br \/>\n$ sudo chown -r git:kuyon \/git\/meraproject.git<br \/>\n$ sudo chmod -r 070 \/git\/meraproject.git<\/code><\/p>\n<p>The above permission means that no one except those found in the group kuyon would have read, write and execute permission.<\/p>\n<p>Now your collaborators can push an existing git project using this command<\/p>\n<p><code>$ git remote add origin rambo@example.com:\/git\/meraproject.git<br \/>\n$ git push -u origin master<\/code><\/p>\n<p>Roffler can clone the repository using rofler@example.com:\/git\/meraproject.git<\/p>\n<p>Then the normal git workflow continues and life continues&#8230;<\/p>\n<p>Note: the commands were written on Ubuntu Server 13.04<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previously, I had set up a git server on my laptop. My friends would access it using my always changing IP. Furthermore, my laptop has to remain online. Setting up a vps as git server First create a git user $sudo adduser git A user and a group git would be created Create accounts for &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2013\/setting-git-server-on-vps\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Setting Git server on VPS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[152,149],"class_list":["post-1883","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-coding","tag-git"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=1883"}],"version-history":[{"count":2,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1883\/revisions"}],"predecessor-version":[{"id":1885,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1883\/revisions\/1885"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=1883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=1883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=1883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}