{"id":43,"date":"2015-10-25T22:27:46","date_gmt":"2015-10-26T02:57:46","guid":{"rendered":"http:\/\/blog.thescorpius.com\/?p=43"},"modified":"2015-10-27T23:13:09","modified_gmt":"2015-10-28T03:43:09","slug":"a-useful-git-tutorial-part-ii","status":"publish","type":"post","link":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/","title":{"rendered":"A Useful Git Tutorial &#8211; Part II"},"content":{"rendered":"<div style=\"width: 40%; padding: 0 10px 0 0; float: left;\">\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-47 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png?resize=300%2C277\" alt=\"git logo\" width=\"300\" height=\"277\" \/><\/p>\n<\/div>\n<p>The most popular questions about git always seem to be the same: \u00a0<em>When should I commit? How often should I commit? What exactly is a\u00a0<strong>branch<\/strong> in my project? What is a\u00a0<strong>tag<\/strong>?<\/em><\/p>\n<p>Before getting into dirty grounds (and\u00a0we&#8217;ll eventually get there) you should know a little about\u00a0<strong>best practices<\/strong> when using git.<\/p>\n<p><em>Note: If you haven&#8217;t read the post <strong>A Useful Git Tutorial &#8211; Part I<\/strong>\u00a0you can\u00a0check it <a href=\"http:\/\/blog.thescorpius.com\/index.php\/2015\/10\/24\/a-useful-git-tutorial-part-i\/\">here<\/a>.<\/em><\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both;\">I&#8217;m sure the questions above\u00a0have different answers depending on who you ask, but if you don&#8217;t have your own answers\u00a0you&#8217;ll get them when you define your <b>workflow<\/b>.<\/div>\n<div style=\"clear: both;\"><\/div>\n<p><!--more--><\/p>\n<h3>Branching Workflows in git<\/h3>\n<p>There are whole chapters in books dedicated to\u00a0<strong>branching workflows\u00a0<\/strong>and you\u00a0should definitely check <a href=\"http:\/\/git-scm.com\/book\/ch3-4.html\">this\u00a0link<\/a>\u00a0if you want know a lot about this. But since this is a\u00a0<em>useful<\/em> tutorial to get you work pretty quick I&#8217;m gonna summarize it drastically here.<\/p>\n<p>The\u00a0<em>best practice\u00a0<\/em>is to\u00a0have the following branches:<\/p>\n<ul>\n<li style=\"clear: both;\"><strong>master:<\/strong> \u00a0This is the\u00a0<em>stable<\/em> branch. The code that will be released. Only\u00a0very well tested code is merged here. Nobody works in this branch directly, just merges from branches that were thoroughly tested. And it is named liked that:\u00a0<strong>master<\/strong><\/li>\n<li style=\"clear: both;\"><strong>develop:<\/strong>\u00a0 These are the branches where the actual developing\u00a0happens. \u00a0Most people name them after\u00a0the version number like &#8220;1_0_1&#8221; or &#8220;1_0_X&#8221; or &#8220;RC_1_0&#8221;.<\/li>\n<li style=\"clear: both;\"><strong>topic:<\/strong> \u00a0These are short-lived branches that implement\u00a0<span style=\"text-decoration: underline;\">a single feature<\/span>. \u00a0If you don&#8217;t want to get in problems later, like you implemented two features in the same branch at the same time, you should stick to that. \u00a0Usually they are named after the feature.<\/li>\n<\/ul>\n<p>This will be your\u00a0<strong>workflow<\/strong>:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/workflow.png?resize=575%2C211\" alt=\"git branching workflow\" width=\"575\" height=\"211\" \/><br \/>\nSo <span style=\"text-decoration: underline;\">when do you\u00a0<\/span><em><span style=\"text-decoration: underline;\">tag<\/span>?<\/em>\u00a0\u00a0Most people tag the release commit\u00a0and that&#8217;s it. Let&#8217;s say you have a branch called\u00a0<em>1_0_X<\/em> where all the development of that version is happening. When you&#8217;re ready to publish your version 1.0.1, then you merge\u00a0the\u00a0<strong>master<\/strong> branch with your\u00a0<em>1_0_X<\/em> branch and tag that commit as your release 1_0_1.<\/p>\n<p><em>How often do I have to commit?<\/em> \u00a0Often. But commit things that work. Never commit code that doesn&#8217;t work or worse one that doesn&#8217;t even compile. Commit a feature. Never commit two features in a single commit. Are you worried that you have way too many commits? There&#8217;s something called <a href=\"https:\/\/sethrobertson.github.io\/GitBestPractices\/#sausage\">Hide the Sausage Making<\/a>, we&#8217;ll get to that in a few posts.<\/p>\n<p>So let&#8217;s get down to business for a little while. All my examples are based in the fork of the <a href=\"http:\/\/github.com\/qbittorrent\/qBittorrent\">qBitorrent<\/a> project because I wanted to implement an\u00a0<a href=\"http:\/\/blog.thescorpius.com\/index.php\/2015\/10\/24\/cookies-support-on-qbittorrent\/\">optional\u00a0cookie field when downloading torrent files from a URL<\/a>.<\/p>\n<p>First clone the repository you want to work on to:<\/p>\n<pre>$ git clone https:\/\/github.com\/qbittorrent\/qBittorrent.git\r\nCloning into 'qBittorrent'...\r\nremote: Counting objects: 71643, done.\r\nremote: Total 71643 (delta 0), reused 0 (delta 0), pack-reused 71643\r\nReceiving objects: 100% (71643\/71643), 109.18 MiB | 124.00 KiB\/s, done.\r\nResolving deltas: 100% (59896\/59896), done.\r\nChecking connectivity... done.<\/pre>\n<p>Create\u00a0my development branch where I will do all the mess. I&#8217;ll give it the lamest name possible:<\/p>\n<pre class=\"\">$ git branch haxor\r\n\r\n~$ git checkout haxor\r\nSwitched to branch 'haxor'\r\n\r\n$ git branch\r\n* haxor\r\n  master\r\n<\/pre>\n<p>Now I&#8217;m in the <em>haxor\u00a0<\/em>branch where I can start making my changes. \u00a0But then again keeping my changes local doesn&#8217;t make me feel safe and I want to push them to a remote repository I have access to. \u00a0Obviously I can&#8217;t mess with the official qBittorrent repository, but I can clone it in GitHub and then I will have a remote repository that I can push my things to. \u00a0First I have to know how to work with remote repositories and after that I will have to solve the nightmare of having two remote repositores, where you\u00a0<strong>can&#8217;t rebase commits that exists somewhere else<\/strong>. \u00a0We&#8217;ll get to that eventually, don&#8217;t worry.<\/p>\n<h3>Remote Repositories<\/h3>\n<p>Like I said <a href=\"http:\/\/blog.thescorpius.com\/index.php\/2015\/10\/24\/a-useful-git-tutorial-part-i\/\">before<\/a>, remote repositories are\u00a0<em>bare<\/em> repositores that allow collaboration between developers. \u00a0You can have several of them for the same project. \u00a0You can push to some of them,\u00a0others are just read only.<\/p>\n<p>Right now I should have only one remote and that&#8217;s the Official GitHub repository for qBittorrent. \u00a0I can check my remotes like this:<\/p>\n<pre class=\"\">$ git remote\r\norigin\r\n\r\n$ git remote -v\r\norigin https:\/\/github.com\/qbittorrent\/qBittorrent.git (fetch)\r\norigin https:\/\/github.com\/qbittorrent\/qBittorrent.git (push)\r\n<\/pre>\n<p>The\u00a0<em>origin<\/em> name is\u00a0the default name of the repository when you do a\u00a0<em>git clone<\/em>.<\/p>\n<p>Now I need a remote repository where I have read\/write access, so I can push my changes and don&#8217;t depend only of the local files. Just like some sort of\u00a0<em>backup<\/em>. \u00a0So I&#8217;m gonna add my GitHub repository for qBittorrent and name it <em>github<\/em>:<\/p>\n<pre class=\"\">$ git remote add github http:\/\/github.com\/naikel\/qBittorrent.git<\/pre>\n<p>&nbsp;<\/p>\n<h3>Example:\u00a0Actual Work With Two Repos<\/h3>\n<p>Now let&#8217;s fix an annoying bug in qBittorrent where it shows the value &#8220;Unknown&#8221; if you have downloaded in the same session\u00a0more than the size of a\u00a0<em>signed integer of 32 bits<\/em>. \u00a0That&#8217;s because 64 bits integers should be used. \u00a0 We need to change two functions from <em>int<\/em> to <em>qlonglong<\/em>:\u00a0totalPayloadUpload() and totalPayloadDownload().<\/p>\n<p>So first you need to create a new branch to do this:<\/p>\n<pre class=\"\">git branch payload_fix<\/pre>\n<p>Then switch to that branch to start working on it:<\/p>\n<pre class=\"\">git checkout payload_fix<\/pre>\n<h4><strong><strong>Common Problem:<\/strong> <\/strong>I already modified the files in the\u00a0wrong branch!<\/h4>\n<p>Don&#8217;t worry, that happens a lot. To see what you have done use the<em> git status<\/em> command:<\/p>\n<pre class=\"theme:git-red-theme lang:git decode:true\">$ git status\r\nOn branch master\r\nChanges not staged for commit:\r\n  (use \"git add ...\" to update what will be committed)\r\n  (use \"git checkout -- ...\" to discard changes in working directory)\r\n\r\n        modified: src\/core\/bittorrent\/torrenthandle.cpp\r\n        modified: src\/core\/bittorrent\/torrenthandle.h<\/pre>\n<p>You can create a new branch and move your modified files there by typing the command:<\/p>\n<pre>git checkout -b payload_fix<\/pre>\n<p>Now let&#8217;s commit the changes. We&#8217;ve already seen how to do this in a previous post:<\/p>\n<pre class=\"theme:git-theme\">$ git add -u\r\n$ git status\r\nOn branch payload_fix\r\nChanges to be committed:\r\n  (use \"git reset HEAD ...\" to unstage)\r\n\r\n        modified:   src\/core\/bittorrent\/torrenthandle.cpp\r\n        modified:   src\/core\/bittorrent\/torrenthandle.h\r\n\r\n$ git commit -m \"Changed payload functions from int to qlonglong in TorrentHandle class\"\r\n[payload_fix 2a2c947] Changed payload functions from int to qlonglong in TorrentHandle class\r\n 2 files changed, 4 insertions(+), 4 deletions(-)\r\n<\/pre>\n<p>Now I&#8217;m going to push the commit to the repo, but I want it to push it to the <em>github<\/em> repository and not the <em>origin<\/em>. Also I want that branch tracking the\u00a0<em>github<\/em>\u00a0repository:<\/p>\n<pre>$ git push -u github<\/pre>\n<p>After that whenever I&#8217;m in that branch I just need to type\u00a0<em>git push<\/em>\u00a0and it will push to github. \u00a0Here&#8217;s the output:<\/p>\n<pre>$ git push -u github\r\nUsername for 'https:\/\/github.com': \r\nPassword for 'https:\/\/@github.com':\r\nCounting objects: 207, done.\r\nDelta compression using up to 4 threads.\r\nCompressing objects: 100% (44\/44), done.\r\nWriting objects: 100% (125\/125), 17.95 KiB | 0 bytes\/s, done.\r\nTotal 125 (delta 106), reused 99 (delta 81)\r\nTo http:\/\/github.com\/naikel\/qBittorrent.git\r\n * [new branch] payload_fix -&gt;; payload_fix\r\nBranch payload_fix set up to track remote branch payload_fix from github.<\/pre>\n<p>To see the differences between this branch and the master you can use this command:<\/p>\n<pre>git diff master<\/pre>\n<p>And to see all the history of commits in the current branch:<\/p>\n<pre>git log<\/pre>\n<p>We&#8217;ll get into worse git problems and how to solve them in the next post about this topic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The most popular questions about git always seem to be the same: \u00a0When should I commit? How often should I commit? What exactly is a\u00a0branch in my project? What is a\u00a0tag? Before getting into dirty grounds (and\u00a0we&#8217;ll eventually get there) you should know a little about\u00a0best practices when using git. Note: If you haven&#8217;t read [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,6,7],"tags":[3,8],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-git","category-linux","category-tutorials","tag-git","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Useful Git Tutorial - Part II - Scorpius<\/title>\n<meta name=\"description\" content=\"When and how often should I commit? What should be a branch in my project? What should be a tag? You&#039;ll get your answers about git in this second part.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Useful Git Tutorial - Part II - Scorpius\" \/>\n<meta property=\"og:description\" content=\"When and how often should I commit? What should be a branch in my project? What should be a tag? You&#039;ll get your answers about git in this second part.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"Scorpius\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-26T02:57:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-10-28T03:43:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png\" \/>\n<meta name=\"author\" content=\"TheScorpius666\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TheScorpius666\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/\"},\"author\":{\"name\":\"TheScorpius666\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/86f96e20f253dad7eb38d3c721a950de\"},\"headline\":\"A Useful Git Tutorial &#8211; Part II\",\"datePublished\":\"2015-10-26T02:57:46+00:00\",\"dateModified\":\"2015-10-28T03:43:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/\"},\"wordCount\":974,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/git-logo-2.png\",\"keywords\":[\"git\",\"tutorial\"],\"articleSection\":[\"git\",\"linux\",\"tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/\",\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/\",\"name\":\"A Useful Git Tutorial - Part II - Scorpius\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/git-logo-2.png\",\"datePublished\":\"2015-10-26T02:57:46+00:00\",\"dateModified\":\"2015-10-28T03:43:09+00:00\",\"description\":\"When and how often should I commit? What should be a branch in my project? What should be a tag? You'll get your answers about git in this second part.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/git-logo-2.png?fit=300%2C277&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/git-logo-2.png?fit=300%2C277&ssl=1\",\"width\":300,\"height\":277},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2015\\\/10\\\/25\\\/a-useful-git-tutorial-part-ii\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.thescorpius.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Useful Git Tutorial &#8211; Part II\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/\",\"name\":\"Scorpius\",\"description\":\"Random technology bits\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.thescorpius.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\",\"name\":\"Scorpius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"caption\":\"Scorpius\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/86f96e20f253dad7eb38d3c721a950de\",\"name\":\"TheScorpius666\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"caption\":\"TheScorpius666\"},\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/author\\\/thescorpius666\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Useful Git Tutorial - Part II - Scorpius","description":"When and how often should I commit? What should be a branch in my project? What should be a tag? You'll get your answers about git in this second part.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/","og_locale":"en_US","og_type":"article","og_title":"A Useful Git Tutorial - Part II - Scorpius","og_description":"When and how often should I commit? What should be a branch in my project? What should be a tag? You'll get your answers about git in this second part.","og_url":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/","og_site_name":"Scorpius","article_published_time":"2015-10-26T02:57:46+00:00","article_modified_time":"2015-10-28T03:43:09+00:00","og_image":[{"url":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png","type":"","width":"","height":""}],"author":"TheScorpius666","twitter_card":"summary_large_image","twitter_misc":{"Written by":"TheScorpius666","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#article","isPartOf":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/"},"author":{"name":"TheScorpius666","@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/86f96e20f253dad7eb38d3c721a950de"},"headline":"A Useful Git Tutorial &#8211; Part II","datePublished":"2015-10-26T02:57:46+00:00","dateModified":"2015-10-28T03:43:09+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/"},"wordCount":974,"commentCount":0,"publisher":{"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501"},"image":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png","keywords":["git","tutorial"],"articleSection":["git","linux","tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/","url":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/","name":"A Useful Git Tutorial - Part II - Scorpius","isPartOf":{"@id":"https:\/\/blog.thescorpius.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#primaryimage"},"image":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png","datePublished":"2015-10-26T02:57:46+00:00","dateModified":"2015-10-28T03:43:09+00:00","description":"When and how often should I commit? What should be a branch in my project? What should be a tag? You'll get your answers about git in this second part.","breadcrumb":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#primaryimage","url":"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png?fit=300%2C277&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2015\/10\/git-logo-2.png?fit=300%2C277&ssl=1","width":300,"height":277},{"@type":"BreadcrumbList","@id":"https:\/\/blog.thescorpius.com\/index.php\/2015\/10\/25\/a-useful-git-tutorial-part-ii\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.thescorpius.com\/"},{"@type":"ListItem","position":2,"name":"A Useful Git Tutorial &#8211; Part II"}]},{"@type":"WebSite","@id":"https:\/\/blog.thescorpius.com\/#website","url":"https:\/\/blog.thescorpius.com\/","name":"Scorpius","description":"Random technology bits","publisher":{"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.thescorpius.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501","name":"Scorpius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","caption":"Scorpius"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g"}},{"@type":"Person","@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/86f96e20f253dad7eb38d3c721a950de","name":"TheScorpius666","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","caption":"TheScorpius666"},"url":"https:\/\/blog.thescorpius.com\/index.php\/author\/thescorpius666\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6SNpd-H","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":50,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/43\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}