{"id":667,"date":"2014-01-10T13:15:54","date_gmt":"2014-01-10T13:15:54","guid":{"rendered":"http:\/\/10sa.com\/sql_stories\/?p=667"},"modified":"2014-03-07T10:28:21","modified_gmt":"2014-03-07T10:28:21","slug":"git-many-scripts-on-many-boxes","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=667","title":{"rendered":"Git (many scripts on many boxes)"},"content":{"rendered":"<p>This post describes the situation when you keep different scripts on many servers and the aim is to aggregate them into one project as well as to ensure the versioning feature.<\/p>\n<p>Create a repository [e.g. sdiserverapps]. Create a branch [e.g. srv2].<br \/>\nYou have to ensure that the option &#8220;&#8211;single-branch&#8221; is available, in contrary compile git:<\/p>\n<p>Download sources<\/p>\n<pre lang=\"bash\">\r\nyum install zlib-devel gettext-devel perl-ExtUtils-MakeMaker curl-devel  -y\r\n# [optional] yum install -y  expat-devel zlib-devel openssl-devel\r\n\r\n# Debian:\r\naptitude install zlib1g-dev libgettextpo-dev libcurl4-dev\r\n\r\n.\/configure\r\nmake\r\nmake install\r\n### when you insalled git packages before [end]\r\nyum erase git\r\n# logout\r\nlogin\r\n### when you insalled git packages before [end]\r\ngit --version\r\ngit version 1.8.5.2 # it means everything is ok\r\n\r\ngit clone -b srv2 --single-branch http:\/\/YOUR_USER@YOUR_HTTP_ADDRESS:7990\/scm\/db\/sdiserverapps.git\r\n\r\ngit config --global user.name \"DBA John Kovalski\"\r\ngit config --global user.email dba@example.org\r\ngit config --global credential.helper 'cache --timeout=3600'\r\n\r\n# let see the changes\r\ngit config --list\r\n<\/pre>\n<p>If you receive the following error it means that you cannot use the specified solution (and your dir was not empty):<\/p>\n<pre lang=\"bash\">\r\ngit clone -b srv2 --single-branch http:\/\/YOUR_USER@YOUR_HTTP_ADDRESS:7990\/scm\/db\/sdiserverapps.git .\/\r\ngit fatal: destination path '.' already exists and is not an empty directory.\r\n<\/pre>\n<p>You can create the branch in the default directory and then move it:<\/p>\n<pre lang=\"bash\">\r\nmv -v .\/sdiserverapps\/.g* .\r\n<\/pre>\n<pre lang=\"bash\">\r\ngit add --all\r\n# check whether all files are desired...\r\ngit commit --dry-run | less\r\ngit commit -m \"first commit\"\r\ngit push \r\n<\/pre>\n<p>Check the actual branch:<\/p>\n<pre lang=\"bash\">\r\ngit branch\r\n<\/pre>\n<p>Remove file from branch:<\/p>\n<pre lang=\"bash\">\r\ngit rm --cache .\/you-file.log \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post describes the situation when you keep different scripts on many servers and the aim is to aggregate them into one project as well as to ensure the versioning feature. Create a repository [e.g. sdiserverapps]. Create a branch [e.g. srv2]. You have to ensure that the option &#8220;&#8211;single-branch&#8221; is available, in contrary compile git: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/667"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=667"}],"version-history":[{"count":16,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/667\/revisions"}],"predecessor-version":[{"id":754,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/667\/revisions\/754"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}