{"id":34,"date":"2020-01-07T06:26:23","date_gmt":"2020-01-07T06:26:23","guid":{"rendered":"https:\/\/aabirtech.com\/shiblenomanblog\/?p=34"},"modified":"2020-09-21T07:10:03","modified_gmt":"2020-09-21T07:10:03","slug":"create-git-repo-from-existing-project","status":"publish","type":"post","link":"https:\/\/aabirtech.com\/shiblenomanblog\/2020\/01\/07\/create-git-repo-from-existing-project\/","title":{"rendered":"Create git repo from existing project"},"content":{"rendered":"\n<p>Often I forget the commands to create git repo from existing project in my local machine. <\/p>\n\n\n\n<p>First step is to init a git repo in your project. Use git bash <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git init<\/code><\/pre>\n\n\n\n<p>Second step to add the project files into local git repo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git add .<\/code><\/pre>\n\n\n\n<p>Use the .(dot) after the add, this is saying add all files. <\/p>\n\n\n\n<p>This command is to commit the files with message. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git commit -m \"Commit message\"<\/code><\/pre>\n\n\n\n<p>Create a repo in the github <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git remote add origin 'remote repository URL'<\/code><\/pre>\n\n\n\n<p>After that use following command to push your code to remote repo in the github. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git push origin master<\/code><\/pre>\n\n\n\n<p>After the this command you should be able to see your code in the github. <\/p>\n\n\n\n<p><em>Happy Coding \ud83d\ude42<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often I forget the commands to create git repo from existing project in my local machine. First step is to init a git repo in your project. Use git bash Second step to add the project files into local git repo Use the .(dot) after the add, this is saying add all files. This command [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":31,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,2],"tags":[10],"class_list":["post-34","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","category-quick-note-to-me","tag-git-github"],"acf":[],"_links":{"self":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":6,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/34\/revisions\/41"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/media\/31"}],"wp:attachment":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}