{"id":496,"date":"2016-06-13T23:26:06","date_gmt":"2016-06-13T21:26:06","guid":{"rendered":"https:\/\/olkn.myvnc.com\/?p=496"},"modified":"2020-05-18T12:35:07","modified_gmt":"2020-05-18T10:35:07","slug":"git","status":"publish","type":"post","link":"https:\/\/olkn.myvnc.com\/?p=496","title":{"rendered":"git cli"},"content":{"rendered":"<p>To backup my arduino sketches I will use a remote git repository hosted on my own server. So lets start<\/p>\n<ul>\n<li>git init &#8211; initialize a new local repository<\/li>\n<li>git clone <user>@<host>:<path\/to\/repo> &#8211; check out\/clone from a remote reporitory<\/li>\n<\/ul>\n<p>The local repo is devided into a working copy, the index as interim stage und the head which is a link to the last commit.<\/p>\n<ul>\n<li>git add <file> &#8211; add a file to local repository<\/li>\n<li>git commit -m &#8220;<commit message>&#8220;<\/li>\n<li>git push origin master &#8211; sync local repository with remote repo<\/li>\n<\/ul>\n<p>If the local repo was not cloned but should be linked to a remote repository use:<\/p>\n<ul>\n<li>git remote add origin <remote server><\/li>\n<\/ul>\n<p>To sync the local repository use:<\/p>\n<ul>\n<li>git pull &#8211; fetch remote changes and merge them with the local files<\/li>\n<li>git add <file> &#8211; inform git about solved merge problems after solving<\/li>\n<\/ul>\n<p>Summary:<\/p>\n<p>git init<\/p>\n<p>git add .<\/p>\n<p>git commit -am &#8220;<comment>&#8221;<\/p>\n<p>git remote add origin <user>@<target>:<folder><\/p>\n<p>git push -u <user> origin master<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To backup my arduino sketches I will use a remote git repository hosted on my own server. So lets start git init &#8211; initialize a new local repository git clone @: &#8211; check out\/clone from a remote reporitory The local repo is devided into a working copy, the index as interim stage und the head &hellip; <a href=\"https:\/\/olkn.myvnc.com\/?p=496\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">git cli<\/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":[14],"tags":[35,51,140,73,79,116,123],"class_list":["post-496","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-administration","tag-debian","tag-git","tag-install","tag-linux","tag-server","tag-sync"],"_links":{"self":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496"}],"version-history":[{"count":4,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/496\/revisions\/638"}],"wp:attachment":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}