{"id":843,"date":"2024-12-15T12:21:34","date_gmt":"2024-12-15T09:21:34","guid":{"rendered":"https:\/\/itgen.itbumper.com\/?page_id=843"},"modified":"2024-12-15T12:25:43","modified_gmt":"2024-12-15T09:25:43","slug":"0090_git-basic","status":"publish","type":"page","link":"https:\/\/itgen.itbumper.com\/?page_id=843","title":{"rendered":"0090_GIT: Basics"},"content":{"rendered":"<p style=\"text-align: justify;\" data-tadv-p=\"keep\">GIT is a popular distributed version control system used to manage changes in source code and other files. It allows developers to track change history, collaborate on projects, and easily revert to previous file versions.<\/p>\n<p style=\"text-align: justify;\"><strong>Key Features of GIT<\/strong>:<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"text-align: justify;\"><strong>Change Tracking<\/strong> \u2014\u00a0 saving the history of changes in files.<\/li>\n<li style=\"text-align: justify;\"><strong>Branching and Merging<\/strong> \u2014 working with parallel code versions and merging them.<\/li>\n<li style=\"text-align: justify;\"><strong>Distributed Nature<\/strong> \u2014\u00a0 each developer has a full repository copy, including the entire history of changes.<\/li>\n<li style=\"text-align: justify;\"><strong>\u00a0Integration with Platforms<\/strong> \u2014 GIT is used on GitHub, GitLab, Bitbucket, and other platforms for collaboration.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCommands used in training:\ngit init                                      \/ initialization a new repository                                    \/\ngit status                                    \/ get info about the repository                                    \/\ngit add &lt;file \/ folder \/ .&gt;                   \/ add file or the whole folder to index (untracked files change their status) \/\ngit commit -m &quot;Some information message&quot;      \/ make a snapshot with a description. No need any action in the VCS    \/\ngit commit &lt;edit in the text editor&gt;          \/ make a snapshot. You need to add some description in the VCS       \/\ngit log                                       \/ get information about commits (snapshoots) in the current branch    \/\ngit branch                                    \/ shows information about the current branch                      \/\ngit branch -a                                 \/ shows all local and remote branches                               \/\ngit branch -m master main                     \/ rename master to main\ngit branch -M main                            \/ set the branch name to main\ngit checkout &lt;branch name&gt;                    \/ switch to another brunch \/\ngit checkout &lt;commit hash sha1&gt;               \/ switch to any commit using the commit hash. Warning &quot;detached HEAD&quot; \/ \ngit switch -                                  \/ exit from &quot;detached HEAD&quot; state \/\ngit cat -t hash                               \/ shows a type: blob or tree \/\ngit cat -p hash                               \/ shows text inside the blob \/\ngit clone &lt;url&gt;                               \/ download the remote repository to your local \/\ngit remote add origin &lt;url&gt;                   \/ make a connection between your local and remote repositories    \/\ngit push -u origin &lt;branch&gt;                   \/ sync your local and remote branch \/\ngit push                                      \/ send updates of your local repository to your remote repository    \/\ngit pull                                      \/ recieve updates from your remote repository to your local repository \/\ngit fetch                                     \/ downloads updates but don`t make changes in the local repository    \/\ngit remote update                             \/ updates all remote repositories                                  \/\ngit remote -v                                 \/ get more information about remote repository                       \/\ngit branch -vv                                \/ shows how the local repository linked with the remote repository  \/\ngit diff                                      \/ show diffents \/\ngit remote set-url origin new.git.url         \/ change the url \/\n\nThe most popular GIT hosting services\nGitHub\nBitBucket\nGitLab\n\n  Tracking status:\n    -untracked    \/marks files and directories not added in the index yet\n    -unmodified   \/added and commited files have no changes\n    -modified     \/commited files have changes since last commit\n    -staged       \/marked a modified file in its current version to go into your next commit snapshot\n\n\nAbout merge strategies: https:\/\/git-scm.com\/docs\/merge-strategies\nUser manual: https:\/\/git-scm.com\/docs\/user-manual\nOfficial book: https:\/\/git-scm.com\/book\/en\/v2\n\nto be continued ...\n\nTags\n \n1. git init\n2. git branch -M main\n3. git add .\n4. git commit -m &quot;your comment&quot;\n5. git remote add origin git@github.com:xxxxxxxx\/yyyyy.git\n6. git push -u origin main\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>GIT is a popular distributed version control system used to manage changes in source code and other files. It allows developers to track change history, collaborate on projects, and easily revert to previous file versions. Key Features of GIT: Change Tracking \u2014\u00a0 saving the history of changes in files. Branching and Merging \u2014 working with &hellip; <a href=\"https:\/\/itgen.itbumper.com\/?page_id=843\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;0090_GIT: Basics&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/843"}],"collection":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=843"}],"version-history":[{"count":2,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/843\/revisions"}],"predecessor-version":[{"id":847,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/843\/revisions\/847"}],"wp:attachment":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}