{"id":107,"date":"2014-05-20T01:40:39","date_gmt":"2014-05-20T01:40:39","guid":{"rendered":"http:\/\/vkrastev1blog.com\/?p=107"},"modified":"2014-05-20T01:43:24","modified_gmt":"2014-05-20T01:43:24","slug":"important-git-commands","status":"publish","type":"post","link":"https:\/\/vkrastev1blog.com\/2014\/05\/20\/important-git-commands\/","title":{"rendered":"Important Git commands and Tutorials"},"content":{"rendered":"<p>How to get help for a Git command<\/p>\n<p><em>git help<\/em> [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND]<\/p>\n<p>Example: git help git<\/p>\n<p>It launches a browser and shows a help in HTML.<\/p>\n<p>Setting up local repository and making initial push:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">cd my_project\r\ngit init\r\ngit add <span class=\"token operator\">*<\/span>\r\ngit commit <span class=\"token operator\">-<\/span>m <span class=\"token string\">\"My initial commit message\"<\/span>\r\ngit remote add origin git@example<span class=\"token punctuation\">.<\/span>com<span class=\"token punctuation\">:<\/span>my_project<span class=\"token punctuation\">.<\/span>git\r\ngit push <span class=\"token operator\">-<\/span>u origin master<\/code><\/pre>\n<p>Checkout repository<\/p>\n<pre><code>git clone git:\/\/github.com\/schacon\/grit.git<\/code><\/pre>\n<p>To commit changes to the local repository just do add, than commit. If you want to push the local branch\/changes to the remote repository just do push command below.<\/p>\n<pre>git add --all\r\n\r\ngit commit --all\r\n\r\ngit push\r\n<\/pre>\n<p>Push to repository command<\/p>\n<pre><code>git push &lt;remote&gt; &lt;local branch name&gt;:&lt;remote branch to push into&gt;<\/code>\r\ngit push [--all | --mirror | --tags] [--follow-tags] [-n | --dry-run] [--receive-pack=]\r\n           [--repo=] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream]\r\n           [--force-with-lease[=[:]]]\r\n           [--no-verify] [ [\u2026]]\r\n<\/pre>\n<p>Further commands to find in the following links.<\/p>\n<p>Everyday Git with 20 commands<\/p>\n<p><a href=\"https:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/everyday.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/everyday.html<\/a><\/p>\n<p>Good Git Tutorials<\/p>\n<p>Tutorial 1 first to make &#8211; <a href=\"http:\/\/git-scm.com\/docs\/gittutorial\" rel=\"nofollow\">http:\/\/git-scm.com\/docs\/gittutorial<\/a><\/p>\n<p>Tutorial 2 second to make &#8211; <a href=\"http:\/\/git-scm.com\/docs\/gittutorial-2.html\" rel=\"nofollow\">http:\/\/git-scm.com\/docs\/gittutorial-2.html<\/a><\/p>\n<p>Further Tutorial &#8211; <a href=\"http:\/\/www.vogella.com\/tutorials\/Git\/article.html#firstgit_repostatus\" rel=\"nofollow\">http:\/\/www.vogella.com\/tutorials\/Git\/article.html#firstgit_repostatus<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to get help for a Git command git help [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND] Example: git help git It launches a browser and shows a help in HTML. Setting up local repository and making initial push: cd my_project git init git add * git commit -m &#8220;My initial commit message&#8221; git remote add origin git@example.com:my_project.git git push [&hellip;]<\/p>\n","protected":false},"author":65283547,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Important Git commands and tutorials","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1017],"tags":[319,209196,29946263,32859840,81652472,19181762],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-java","tag-commands","tag-git","tag-git-commands","tag-git-tutorial","tag-how-to-use-git","tag-using-git"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4CoHV-1J","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/users\/65283547"}],"replies":[{"embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":4,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}