{"id":446,"date":"2018-01-26T01:39:08","date_gmt":"2018-01-26T01:39:08","guid":{"rendered":"http:\/\/www.asianux.org.vn\/?p=446"},"modified":"2018-01-26T01:59:14","modified_gmt":"2018-01-26T01:59:14","slug":"huong-dan-su-dung-git","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2018\/01\/26\/huong-dan-su-dung-git\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng GIT"},"content":{"rendered":"<p>&nbsp;<\/p>\n<ol>\n<li>Initialize the local directory as a Git repository.\n<pre class=\"command-line\"><span class=\"command\">git init<\/span>\r\n<\/pre>\n<\/li>\n<li>Add the files in your new local repository. This stages them for the first commit.\n<pre class=\"command-line\"><span class=\"command\">git add .<\/span>\r\n<span class=\"comment\"># Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD <em>YOUR-FILE<\/em>'.<\/span>\r\n<\/pre>\n<\/li>\n<li>Commit the files that you&#8217;ve staged in your local repository.\n<pre class=\"command-line\"><span class=\"command\">git commit -m \"First commit\"<\/span>\r\n<span class=\"comment\"># Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.<\/span>\r\n<\/pre>\n<\/li>\n<li><img decoding=\"async\" src=\"https:\/\/help.github.com\/assets\/images\/help\/repository\/copy-remote-repository-url-quick-setup.png\" alt=\"Copy remote repository URL field\" title=\"\">At the top of your GitHub repository&#8217;s Quick Setup page, click\u00a0\u00a0to copy the remote repository URL.<\/li>\n<li>In the Command prompt,\u00a0<a href=\"https:\/\/help.github.com\/articles\/adding-a-remote\" target=\"_blank\" rel=\"noopener\">add the URL for the remote repository<\/a>\u00a0where your local repository will be pushed.\n<pre class=\"command-line\"><span class=\"command\">git remote add origin <em>remote repository URL<\/em><\/span>\r\n<span class=\"comment\"># Sets the new remote<\/span>\r\n<span class=\"command\">git remote -v<\/span>\r\n<span class=\"comment\"># Verifies the new remote URL<\/span>\r\n<\/pre>\n<\/li>\n<li><a href=\"https:\/\/help.github.com\/articles\/pushing-to-a-remote\" target=\"_blank\" rel=\"noopener\">Push the changes<\/a>\u00a0in your local repository to GitHub.\n<pre class=\"command-line\"><span class=\"command\">git push origin master<\/span>\r\n<span class=\"comment\"># Pushes the changes in your local repository up to the remote repository you specified as the origin<\/span><\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Initialize the local directory as a Git repository. git init Add the files in your new local repository. This stages them for the first commit. git add . # Adds the files in the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":449,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programing"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=446"}],"version-history":[{"count":1,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/446\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/446\/revisions\/448"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media\/449"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}