{"id":166,"date":"2024-09-04T06:06:52","date_gmt":"2024-09-04T06:06:52","guid":{"rendered":"https:\/\/www.mhtechin.com\/support\/?p=166"},"modified":"2024-09-04T06:06:52","modified_gmt":"2024-09-04T06:06:52","slug":"basic-git-commands","status":"publish","type":"post","link":"https:\/\/www.mhtechin.com\/support\/basic-git-commands\/","title":{"rendered":"Basic Git Commands"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>git init<\/code><\/strong>: Initializes a new Git repository.<\/li>\n\n\n\n<li><strong><code>git clone &lt;repository-url&gt;<\/code><\/strong>: Clones an existing repository from a URL to your local machine.<\/li>\n\n\n\n<li><strong><code>git status<\/code><\/strong>: Shows the status of changes in the working directory.<\/li>\n\n\n\n<li><strong><code>git add &lt;file&gt;<\/code><\/strong>: Stages changes in a file for the next commit.<\/li>\n\n\n\n<li><strong><code>git commit -m \"commit message\"<\/code><\/strong>: Commits the staged changes with a message.<\/li>\n\n\n\n<li><strong><code>git push<\/code><\/strong>: Pushes commits from your local repository to the remote repository.<\/li>\n\n\n\n<li><strong><code>git pull<\/code><\/strong>: Fetches and merges changes from the remote repository to your local branch.<\/li>\n\n\n\n<li><strong><code>git branch<\/code><\/strong>: Lists, creates, or deletes branches.<\/li>\n\n\n\n<li><strong><code>git checkout &lt;branch-name&gt;<\/code><\/strong>: Switches to a different branch.<\/li>\n\n\n\n<li><strong><code>git merge &lt;branch-name&gt;<\/code><\/strong>: Merges the specified branch into the current branch.<\/li>\n\n\n\n<li><strong><code>git log<\/code><\/strong>: Displays the commit history for the current branch.<\/li>\n\n\n\n<li><strong><code>git remote -v<\/code><\/strong>: Shows the remote repositories linked to your local repository.<\/li>\n\n\n\n<li><strong><code>git reset &lt;file&gt;<\/code><\/strong>: Unstages a file, keeping the changes in the working directory.<\/li>\n\n\n\n<li><strong><code>git diff<\/code><\/strong>: Shows the differences between the working directory and the staged changes.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-166","post","type-post","status-publish","format-standard","hentry","category-support"],"_links":{"self":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/comments?post=166"}],"version-history":[{"count":1,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/166\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/media?parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/categories?post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/tags?post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}