{"id":1745,"date":"2013-06-21T23:26:55","date_gmt":"2013-06-21T15:26:55","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=1745"},"modified":"2013-06-21T23:36:02","modified_gmt":"2013-06-21T19:36:02","slug":"upload-files-to-your-web-server-using-git","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2013\/upload-files-to-your-web-server-using-git\/","title":{"rendered":"Upload Files to your Web Server using Git"},"content":{"rendered":"<p>If you upload files frequently to your web server, you&#8217;ll know how much of a pain it can be to upload only the files needed. I had resorted to another method of zipping everything on my computer, upload to the server, then extract from there replacing all my files. But\u00a0<a href=\"https:\/\/nayarweb.com\/blog\/2013\/the-lazier-the-more-modular-programmer\/\">as a lazy guy<\/a>, this was simply unacceptable! And guess what? I found the perfect solution.<\/p>\n<div><a href=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/06\/gitftp.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1749\" alt=\"git-ftp\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/06\/gitftp-300x153.jpg\" width=\"300\" height=\"153\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/06\/gitftp-300x153.jpg 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/06\/gitftp-1024x523.jpg 1024w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/06\/gitftp.jpg 1051w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/div>\n<div><\/div>\n<div><b><span style=\"text-decoration: underline;\">git-ftp<\/span><\/b> (<a href=\"https:\/\/github.com\/git-ftp\/git-ftp\" target=\"_blank\">GitHub repo<\/a>)<\/div>\n<div><\/div>\n<div>So, i install git-ftp on my Kubuntu.<\/div>\n<div><\/div>\n<div>You need to have an ftp account created on your web server.<\/div>\n<div><\/div>\n<div>Initially you need to push using this command<\/div>\n<div>\n<pre style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; margin-top: 15px; margin-bottom: 15px; background-color: #f8f8f8; border: 1px solid #dddddd; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: #333333;\"><code style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;\">git ftp init -u &lt;user&gt; -p - ftp:\/\/host.example.com\/public_html<\/code><\/pre>\n<\/div>\n<div>Everytime your mates or yourself commit\/push to your remote \u00a0git repository, you run these 2 lines and the changes get reflected on your live server in less than 2 mins. \ud83d\ude00<\/div>\n<div>\n<pre style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; margin-top: 15px; margin-bottom: 15px; background-color: #f8f8f8; border: 1px solid #dddddd; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: #333333;\"><code style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;\">git pull origin master<\/code><\/pre>\n<\/div>\n<div>\n<pre style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; margin-top: 15px; margin-bottom: 15px; background-color: #f8f8f8; border: 1px solid #dddddd; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: #333333;\"><code style=\"font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;\">git ftp push --user &lt;user&gt; --passwd &lt;password&gt; ftp:\/\/host.example.com\/public_html<\/code><\/pre>\n<\/div>\n<div>It uploads only files that has been changed. It&#8217;s almost like magic. LOL \ud83d\ude1b<\/div>\n<div><\/div>\n<div>You can even create a shell script for these 2 lines if you&#8217;re like lazy to the extreme. But i just press the up button in my terminal and the codes are already here. \ud83d\ude09<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you upload files frequently to your web server, you&#8217;ll know how much of a pain it can be to upload only the files needed. I had resorted to another method of zipping everything on my computer, upload to the server, then extract from there replacing all my files. But\u00a0as a lazy guy, this was &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2013\/upload-files-to-your-web-server-using-git\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Upload Files to your Web Server using Git<\/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":[149,57,61,117],"class_list":["post-1745","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-git","tag-kubuntu","tag-linux","tag-web-development"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1745","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=1745"}],"version-history":[{"count":3,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1745\/revisions"}],"predecessor-version":[{"id":1748,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1745\/revisions\/1748"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}