{"id":129,"date":"2012-05-29T23:45:18","date_gmt":"2012-05-30T03:45:18","guid":{"rendered":"http:\/\/lichun.cc\/blog\/?p=129"},"modified":"2012-05-29T23:45:18","modified_gmt":"2012-05-30T03:45:18","slug":"setup-git-on-godaddy-linux-economy-host","status":"publish","type":"post","link":"https:\/\/www.lichun.cc\/blog\/2012\/05\/setup-git-on-godaddy-linux-economy-host\/","title":{"rendered":"setup Git on Godaddy linux economy host"},"content":{"rendered":"<p>There is no version control on Godaddy linux host, which makes the code deployment very painful. So here is how to setup Git on the Godaddy host.<\/p>\n<p>In this tutorial, we set repository on the Godaddy host.<\/p>\n<p>1. <a title=\"centos5.2-git-binary\" href=\"http:\/\/www.lichun.cc\/resources\/centos5.2-git.tar.gz\" target=\"_blank\">download the pre-build git binaries<\/a>, Godaddy uses CentOS, and the binary is built under CentOS. (Thanks to <a href=\"http:\/\/johntrammell.com\/wp\/2011\/01\/05\/using-git-on-godaddy\/\" target=\"_blank\">here<\/a>)<br \/>\nIn your $HOME folder on Godaddy host<\/p>\n<pre>% mkdir lib\n% cd lib\n% mkdir git\n% cd git\n% wget http:\/\/www.lichun.cc\/resources\/centos5.2-git.tar.gz\n% tar -xvzf centos5.2-git.tar.gz<\/pre>\n<p><!--more--><\/p>\n<p>2. edit the <strong>$HOME\/.bash_profile<\/strong> file, add the following lines:(please change the <strong>\/your\/home\/path<\/strong> part)<\/p>\n<pre>export GIT_PATH=\/your\/home\/path\/lib\/git\nexport PATH=$PATH:$GIT_PATH\/libexec\/git-core\nexport LD_LIBRARY_PATH=$GIT_PATH\/lib\nexport GIT_EXEC_PATH=$GIT_PATH\/libexec\/git-core\nexport GIT_TEMPLATE_DIR=$GIT_PATH\/share\/git-core\/templates<\/pre>\n<p>3. create repository in godaddy host, you can create the folder anyware you like, I use <strong>$HOME<\/strong> here<\/p>\n<pre>% mkdir mysite\n% cd mysite\n% touch README\n% git init\n% git add README\n% git commit -m 'empty git repository'\n% cd ..\n% git clone --bare mysite mysite.git<\/pre>\n<p>4. clone the repository on your <strong>local<\/strong> machine<\/p>\n<pre>git clone -u lib\/git\/libexec\/git-core\/git-upload-pack username@site_url:~\/mysite.git<\/pre>\n<p>5. config the git remote path on your <strong>local<\/strong> machine<\/p>\n<pre>git config remote.origin.receivepack lib\/git\/libexec\/git-core\/git-receive-pack\ngit config remote.origin.uploadpack lib\/git\/libexec\/git-core\/git-upload-pack<\/pre>\n<p>6. in godaddy host, change the <strong>.git\/config<\/strong> file, add the following codes: (please change the <strong>\/your\/home\/path<\/strong> part)<\/p>\n<pre>[remote \"origin\"]\n        fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\n        url = \/your\/home\/path\/mysite.git\n[branch \"master\"]\n        merge = refs\/heads\/master\n        remote = origin<\/pre>\n<p>7. Now you can try <strong>git push<\/strong>, <strong>git commit<\/strong> on your <strong>local<\/strong> machine and <strong>git pull<\/strong> on your godaddy host<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is no version control on Godaddy linux host, which makes the code deployment very painful. So here is how to setup Git on the Godaddy host. In this tutorial, we set repository on the Godaddy host. 1. download the pre-build git binaries, Godaddy uses CentOS, and the binary is built under CentOS. (Thanks to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[13],"tags":[28,27,5],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2s9sh-25","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/posts\/129"}],"collection":[{"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":0,"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lichun.cc\/blog\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}