<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tobias Günther</title>
    <description>The latest articles on DEV Community by Tobias Günther (@gntr).</description>
    <link>https://dev.to/gntr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F458046%2F925bcead-5436-47c8-9019-cc45bd088935.png</url>
      <title>DEV Community: Tobias Günther</title>
      <link>https://dev.to/gntr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gntr"/>
    <language>en</language>
    <item>
      <title>9 Reasons Why Code Breaks</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 16 Feb 2021 08:26:14 +0000</pubDate>
      <link>https://dev.to/gittower/9-reasons-why-code-breaks-13kh</link>
      <guid>https://dev.to/gittower/9-reasons-why-code-breaks-13kh</guid>
      <description>&lt;h3&gt;
  
  
  1. Code is Untested
&lt;/h3&gt;

&lt;p&gt;Changing code in one place all too often breaks code in a (seemingly) unrelated place. No matter how experienced you might be: you won't be able to predict the possible side effects that code changes can have. That's what gives our jobs that "thrilling touch"...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Back your code with &lt;strong&gt;automated tests&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  2. Code Does Not Report Errors
&lt;/h3&gt;

&lt;p&gt;You won't easily become aware of all your application's problems: some will only surface in very rare circumstances or with seldom used features. Although you cannot &lt;em&gt;prevent&lt;/em&gt; or &lt;em&gt;foresee&lt;/em&gt; all problems, you should at least make sure you're made aware as they &lt;em&gt;happen&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use &lt;strong&gt;exception reporting&lt;/strong&gt; mechanisms, e.g. through services like &lt;a href="https://appcenter.ms"&gt;AppCenter&lt;/a&gt; or &lt;a href="https://airbrake.io/"&gt;Airbrake.io&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  3. Code Remains Isolated too Long
&lt;/h3&gt;

&lt;p&gt;Developing and keeping unfinished code separate from your production code is a sign of good breeding. However, not keeping your feature code &lt;em&gt;up-to-date&lt;/em&gt; with other important development in your project will cause problems. Because the later and less often you integrate your new code with the rest of your project, the higher the risk of things not being compatible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Integrate often! Make &lt;strong&gt;continuous integration&lt;/strong&gt; part of your development workflow.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  4. Code is Developed in Isolation
&lt;/h3&gt;

&lt;p&gt;"Mike is the only one who knows this part of the code." And as it stands, Mike just started his 6-week vacation in the Himalaya... When code is developed by a single person in isolation, that code is fully dependent on that person. Whenever the developer is on vacation, sick, or busy with other stuff, that critical bug can't be fixed or that feature can't be added.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Consider &lt;strong&gt;pair programming&lt;/strong&gt; and/or regular &lt;strong&gt;code reviews&lt;/strong&gt; to share "code ownership".&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  5. Code Solves Problems That Aren't There
&lt;/h3&gt;

&lt;p&gt;Every piece of code solves a problem. And ideally, it should only solve a problem you &lt;em&gt;have&lt;/em&gt; (or are very likely to have). Of course, an endless number of other problems can be imagined... but trying to solve them when you're not likely to actually &lt;em&gt;have&lt;/em&gt; them will make your code more complex than necessary.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure you &lt;strong&gt;don't overengineer&lt;/strong&gt;. Keep things as simple as possible.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  6. Code Reinvents the Wheel
&lt;/h3&gt;

&lt;p&gt;Any time you're looking at a programming problem, chances are that someone else has had the same problem before. And if you're lucky, the problem has not only been solved in a good enough way - but the solution has also been published. In that case, trying to write this code yourself would be the classic reinvention of the wheel - and a waste of your precious time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep your eyes open for good &lt;strong&gt;third-party libraries&lt;/strong&gt; that have stood the test in other projects already.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  7. Code Depends on too Many External Pieces
&lt;/h3&gt;

&lt;p&gt;While external libraries can lighten your workload, they can (unfortunately) also bite you: when they introduce bugs, when they increase loading time, when their development is discontinued, when you simply have too many of them in your project to keep an overview...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use &lt;strong&gt;third-party libraries&lt;/strong&gt; only when you're convinced that they are of high quality - and you really need them.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  8. Code is Not Actively Maintained
&lt;/h3&gt;

&lt;p&gt;Code rots. It's a sad but true fact. While some parts in a project change and evolve, others are left behind. These parts become liabilities over time. For example, because framework features became obsolete; or because the new code's demands aren't satisfied anymore.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Schedule time for regular &lt;strong&gt;refactorings&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  9. Code is Not Properly Version-Controlled
&lt;/h3&gt;

&lt;p&gt;Although most teams nowadays &lt;em&gt;use&lt;/em&gt; a version control system like Git, they often &lt;em&gt;don't&lt;/em&gt; use its full potential! Git has much more to offer than just "commit, pull, and push". Learning the more advanced stuff (from Interactive Rebase to Git's many "undo" features) can improve the quality of a code base tremendously!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Go beyond the basics and learn to use the more &lt;strong&gt;advanced features of Git&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;If you want to take No. 9 - your Git knowledge - to the next level, I have a couple of tips for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://git-tower.com/learn/git/ebook/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=reasons-why-code-breaks"&gt;Learn version control with Git&lt;/a&gt;, a beginner-friendly online book.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://git-tower.com/learn/git/first-aid-kit/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=reasons-why-code-breaks"&gt;First Aid Kit for Git&lt;/a&gt;, a series of short videos on how to undo mistakes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://git-tower.com/learn/cheat-sheets/git/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=reasons-why-code-breaks"&gt;Git Cheat Sheet&lt;/a&gt;, a nice overview of the most important commands.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>github</category>
    </item>
    <item>
      <title>Become a Better Programmer: 5 Essential Methods at a Glance</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Wed, 27 Jan 2021 08:35:21 +0000</pubDate>
      <link>https://dev.to/gittower/become-a-better-programmer-5-essential-methods-at-a-glance-25bh</link>
      <guid>https://dev.to/gittower/become-a-better-programmer-5-essential-methods-at-a-glance-25bh</guid>
      <description>&lt;h2&gt;
  
  
  1. Unit Testing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Every programmer has experienced something like this: you change a bit of code in one corner, and in a (seemingly) unrelated corner, something breaks! The bitter truth is: both new and changed code will inevitably contain bugs. Use automated tests that help you keep old code stable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; You can also go one step further and write tests &lt;em&gt;before&lt;/em&gt; your actual code. This can give you a whole new perspective on how to approach problems!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; XP on &lt;a href="http://www.extremeprogramming.org/rules/unittests.html" rel="noopener noreferrer"&gt;Unit Tests&lt;/a&gt; and &lt;a href="http://www.extremeprogramming.org/rules/testfirst.html" rel="noopener noreferrer"&gt;Test-Driven Development&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Code Review
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Code that is ever only seen by a single programmer in your team is dangerous code: if that person gets sick or leaves your team, no one knows how this piece of your software really works. Additionally, no matter how great and experienced that developer is: it might be that he overlooked something, implementing only the second best solution.&lt;/p&gt;

&lt;p&gt;These problems can easily be avoided by always having team members approve each other's code. It's both a quality control as well as a means to create collective ownership of your project's code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; If pair programming (see below) is already an integral part of your workflow, you might not need additional code reviews!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; Code Review on the blogs of &lt;a href="https://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/" rel="noopener noreferrer"&gt;IBM&lt;/a&gt; and &lt;a href="http://www.codinghorror.com/blog/2006/01/code-reviews-just-do-it.html" rel="noopener noreferrer"&gt;Jeff Atwood&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Pair Programming
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Pair programming is an ideal tool to share knowledge in a team. Having a junior and a senior developer sitting side-by-side is the best way for the junior to learn. And since teaching is a great way to sharpen your own skills, even the senior can benefit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; Make sure that each person gets in front of the keyboard on a rotating basis. It shouldn't become a "I teach, you listen" event.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; XP about &lt;a href="http://www.extremeprogramming.org/rules/pair.html" rel="noopener noreferrer"&gt;Pair Programming&lt;/a&gt;, Martin Fowler on &lt;a href="http://martinfowler.com/bliki/PairProgrammingMisconceptions.html" rel="noopener noreferrer"&gt;Pair Programming Misconceptions&lt;/a&gt;, WikiHow on &lt;a href="http://www.wikihow.com/Pair-Program" rel="noopener noreferrer"&gt;Pair Programming&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Keep it Simple
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Planning for the unlikely makes code unnecessarily complex. Don't try to foresee your project's requirements in two years from now - too many things can (and &lt;strong&gt;will&lt;/strong&gt;) change! You would waste time on an overly complex solution for a problem that proves to be different than you thought.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; Keeping it simple shouldn't be confused with "quick and dirty". You still have to work thoroughly and carefully!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; &lt;a href="http://people.apache.org/~fhanik/kiss.html" rel="noopener noreferrer"&gt;KISS&lt;/a&gt; on apache.org&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Design Patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; At its core, most programming problems belong to one of only a few general categories. These general problems have already been solved thousands of times - and are well-documented in a couple of "design patterns". Step back from the problem in front of you. And you'll be able to apply a proven best practice instead of reinventing the wheel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; Applying design patterns shouldn't become a religion. Sometimes, all that's really necessary are a few lines of simple code...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; A classic &lt;a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612" rel="noopener noreferrer"&gt;design patterns book&lt;/a&gt;, &lt;a href="http://net.tutsplus.com/articles/general/a-beginners-guide-to-design-patterns/" rel="noopener noreferrer"&gt;A beginner's guide to design patterns&lt;/a&gt; on net.tutsplus.com&lt;/p&gt;

&lt;h2&gt;
  
  
  (Bonus) 6. Version Control with Git
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Git and version control are often underestimated: being proficient with Git has the power to make you a better programmer - and help you build a better code base!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in mind:&lt;/strong&gt; Git is about more than just "commit, push, pull". Take its many "undo" features and you'll quickly understand how helpful it can be!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more:&lt;/strong&gt; A completely free online book on &lt;a href="https://git-tower.com/learn/git/ebook/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=become-a-better-programmer" rel="noopener noreferrer"&gt;Learning version control with Git&lt;/a&gt; and the &lt;a href="https://git-tower.com/learn/git/first-aid-kit/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=become-a-better-programmer" rel="noopener noreferrer"&gt;First Aid Kit&lt;/a&gt;, a series of short videos on how to undo mistakes in Git.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-tower.com/learn/git/ebook/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=become-a-better-programmer" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4kxu1socpgz8h1aqdsln.png" alt="wv1tlckw577joxxkemdw"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
      <category>testing</category>
    </item>
    <item>
      <title>First Aid Kit for Git</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Wed, 02 Dec 2020 08:49:22 +0000</pubDate>
      <link>https://dev.to/gittower/first-aid-kit-for-git-253a</link>
      <guid>https://dev.to/gittower/first-aid-kit-for-git-253a</guid>
      <description>&lt;p&gt;Here's the good news: &lt;strong&gt;Git allows you to undo almost any mistake!&lt;/strong&gt; 🤩&lt;br&gt;
But the bad news is: &lt;strong&gt;You have to know the right commands &amp;amp; tools!&lt;/strong&gt; 😩&lt;/p&gt;

&lt;p&gt;To help you learn the various ways to save your neck, I've compiled a series of &lt;strong&gt;17 short videos&lt;/strong&gt; and a handy cheat sheet - &lt;strong&gt;free&lt;/strong&gt; to download! &lt;/p&gt;

&lt;p&gt;You'll learn how to...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;...correct and fix your very last commit&lt;/li&gt;
&lt;li&gt;...discard uncommitted changes in your working copy&lt;/li&gt;
&lt;li&gt;...undo and revert an old commit&lt;/li&gt;
&lt;li&gt;...return to a previous version of your project&lt;/li&gt;
&lt;li&gt;...restore a deleted branch or commit&lt;/li&gt;
&lt;li&gt;...deal with merge conflicts like a pro&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go ahead and &lt;a href="https://www.git-tower.com/learn/git/first-aid-kit/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=first-aid-kit"&gt;download my "First Aid Kit for Git" for free&lt;/a&gt; and learn how to undo your mistakes like a Pro!&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding the Concept of Branches in Git</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Thu, 26 Nov 2020 07:47:13 +0000</pubDate>
      <link>https://dev.to/gittower/understanding-the-concept-of-branches-in-git-3a38</link>
      <guid>https://dev.to/gittower/understanding-the-concept-of-branches-in-git-3a38</guid>
      <description>&lt;p&gt;Using branches in your day-to-day work might very well prove to make you a better programmer or designer. Be that as it may, it's definitely one of the main reasons why Git is so highly respected. And although desktop GUIs like "&lt;a href="https://www.git-tower.com?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-the-concept-of-branches" rel="noopener noreferrer"&gt;Tower&lt;/a&gt;" make all of this a lot easier, it still makes sense to have a firm understanding of the underlying concepts!&lt;/p&gt;




&lt;p&gt;First of all, if you're coming from another version control system, I kindly ask you to forget the things you already know about branching &amp;amp; merging. It's true that Git hasn't invented this particular wheel: many other VCS also offer branching. However, Git's concepts in this area are absolutely unique when it comes to ease of use and performance.&lt;/p&gt;

&lt;p&gt;Now, let's look at why branches are so important.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working in Contexts
&lt;/h2&gt;

&lt;p&gt;In every project, there are always multiple different &lt;strong&gt;contexts&lt;/strong&gt; where work happens. Each feature, bugfix, experiment, or alternative of your product is actually a context of its own: it can be seen as its own "topic", clearly separated from other topics.&lt;/p&gt;

&lt;p&gt;This leaves you with an unlimited amount of different contexts. Most likely, you'll have at least one context for your "main" or "production" state, and another context for each feature, bugfix, experiment, etc.&lt;/p&gt;

&lt;p&gt;In real-world projects, work always happens in multiple of these contexts &lt;em&gt;in parallel&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While you're preparing 2 new variations of your website's design (context 1 &amp;amp; 2)...&lt;/li&gt;
&lt;li&gt;you're also trying to fix an annoying bug (context 3).&lt;/li&gt;
&lt;li&gt;Besides, you also update some content on your FAQ pages (context 4), while...&lt;/li&gt;
&lt;li&gt;your teammate is working on a new feature for your shopping cart (context 5),...&lt;/li&gt;
&lt;li&gt;and another colleague is experimenting with a whole new login functionality (context 6).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A World Without Branches
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Not&lt;/strong&gt; working in clearly separated contexts can (and sooner or later &lt;strong&gt;will&lt;/strong&gt;) cause several problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens if your client likes variation 2 of the new design? In the meantime, a host of other changes have happened! How do you launch the new design while integrating all these other changes instead of losing them?&lt;/li&gt;
&lt;li&gt;What happens if the shopping cart feature became obsolete because the client changed his mind? How do you get all that unwanted code (and only that code!) out?&lt;/li&gt;
&lt;li&gt;What do you do if that new login functionality proves to be impossible to implement? It's already mingled with all of those other changes, being almost impossible to separate out!&lt;/li&gt;
&lt;li&gt;How can you avoid losing track? Most likely, you shouldn't be bothered with all the topics from all of your colleagues.
Things will start to get very confusing when you try to handle multiple topics in a single context:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2zydtbq8wncs9d2i9wsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2zydtbq8wncs9d2i9wsq.png" alt="one-context"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;A tempting workaround might  be to simply copy your complete project folder for each new context. But this only leaves you with other problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You circumvent your VCS, since those new folders won't be under version control.&lt;/li&gt;
&lt;li&gt;Not being version controlled, you can't easily share &amp;amp; collaborate with others.&lt;/li&gt;
&lt;li&gt;Integrating changes from one context into another (maybe your main context) is difficult and error-prone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To make a long story short: if your goal is to work professionally, you'll have to find a way to deal with multiple contexts in a professional manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branches to the Rescue
&lt;/h2&gt;

&lt;p&gt;You might have already guessed it: branches are what we need to solve these problems. Because a branch represents exactly such a context in a project and helps you keep it separate from all other contexts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F18repx38nvbi4ncne3v7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F18repx38nvbi4ncne3v7.png" alt="multiple-contexts"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This was an excerpt from my (&lt;strong&gt;completely free!!&lt;/strong&gt;) online book &lt;a href="https://www.git-tower.com/learn/git/ebook?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-the-concept-of-branches" rel="noopener noreferrer"&gt;"Learn Version Control with Git"&lt;/a&gt;. Feel free to read more if you want to understand &lt;em&gt;How branches can solve these problems&lt;/em&gt;, &lt;em&gt;How to create and manage them&lt;/em&gt;, &lt;em&gt;How to integrate changes between branches&lt;/em&gt; and &lt;em&gt;where remote branches come into play&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-tower.com/learn/git/ebook?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-the-concept-of-branches" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhqcbk5vnzacvofekh007.png" alt="ebook-learn-version-control"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Best Practices for Version Control with Git</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 03 Nov 2020 16:46:36 +0000</pubDate>
      <link>https://dev.to/gittower/best-practices-for-version-control-with-git-3cae</link>
      <guid>https://dev.to/gittower/best-practices-for-version-control-with-git-3cae</guid>
      <description>&lt;p&gt;Today, version control should be part of every developer’s tool kit. Knowing the basic rules, however, makes it &lt;em&gt;even more useful&lt;/em&gt;. We’ve compiled some best practices that help you get the most out of version control with Git.&lt;/p&gt;


 
&lt;h2&gt;
  
  
  1. Commit Related Changes
&lt;/h2&gt;

&lt;p&gt;A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Commit Often
&lt;/h2&gt;

&lt;p&gt;Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it’s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having few large commits and sharing them rarely, in contrast, makes it hard to solve conflicts.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Don’t Commit Half-Done Work
&lt;/h2&gt;

&lt;p&gt;You should only commit code when it’s completed. This doesn’t mean you have to complete a whole, large feature before committing. Quite the contrary: split the feature’s implementation into logical chunks and remember to commit early and often. But don’t commit just to have something in the repository before leaving the office at the end of the day. If you’re tempted to commit just because you need a clean working copy (to check out a branch, pull in changes, etc.) consider using Git’s “Stash” feature instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Test Before You Commit
&lt;/h2&gt;

&lt;p&gt;Resist the temptation to commit something that you “think” is completed. Test it thoroughly to make sure it really is completed and has no side effects (as far as one can tell). While committing half-baked things in your local repository only requires you to forgive yourself, having your code tested is even more important when it comes to pushing / sharing your code with others.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Write Good Commit Messages
&lt;/h2&gt;

&lt;p&gt;Begin your message with a short summary of your changes (up to 50 characters as a guideline). Separate it from the following body by including a blank line. The body of your message should provide detailed answers to the following questions: What was the motivation for the change? How does it differ from the previous implementation? Use the imperative, present tense („change“, not „changed“ or „changes“) to be consistent with generated messages from commands like git merge.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Version Control is not a Backup System
&lt;/h2&gt;

&lt;p&gt;Having your files backed up on a remote server is a nice side effect of having a version control system. But you should not use your VCS like it was a backup system. When doing version control, you should pay attention to committing semantically (see “related changes”) – you shouldn’t just cram in files.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Use Branches
&lt;/h2&gt;

&lt;p&gt;Branching is one of Git’s most powerful features – and this is not by accident: quick and easy branching was a central requirement from day one. Branches are the perfect tool to help you avoid mixing up different lines of development. You should use branches extensively in your development workflows: for new features, bug fixes, ideas…&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Agree on a Workflow
&lt;/h2&gt;

&lt;p&gt;Git lets you pick from a lot of different workflows: long-running branches, topic branches, merge or rebase, git-flow… Which one you choose depends on a couple of factors: your project, your overall development and deployment workflows and (maybe most importantly) on your and your teammates’ personal preferences. However you choose to work, just make sure to agree on a common workflow that everyone follows.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Go Beyond the Basics
&lt;/h2&gt;

&lt;p&gt;It's true that you can "survive" knowing just a handful of Git commands. But you'll be missing out on much of Git's power if you don't learn about advanced features like Interactive Rebase, the Reflog, or Submodules. Take some time to go beyond the basics and let Git help you write better software!&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Use Tools to Be More Productive
&lt;/h2&gt;

&lt;p&gt;In the last couple of years, the ecosystem around Git has become incredibly powerful: from code hosting services like GitHub, Gitlab, and Azure DevOps all the way to &lt;a href="https://www.git-tower.com/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=best-practices-for-version-control-with-git" rel="noopener noreferrer"&gt;desktop GUIs like Tower&lt;/a&gt;. Choose your tools carefully and let them help you work more easily and productively with Git.&lt;/p&gt;



&lt;h2&gt;
  
  
  Learn More
&lt;/h2&gt;

&lt;p&gt;Of course, there's a lot more to know and understand about Git! If you want to learn more, have a look at my &lt;strong&gt;free&lt;/strong&gt; online book on "&lt;a href="https://git-tower.com/learn/git/ebook/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=best-practices-for-version-control-with-git" rel="noopener noreferrer"&gt;Learning Version Control with Git&lt;/a&gt;".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-tower.com/learn/git/ebook/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=best-practices-for-version-control-with-git" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwv1tlckw577joxxkemdw.png" alt="ebook-learn-version-control"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding Rebase (And Merge) in Git</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 20 Oct 2020 15:26:53 +0000</pubDate>
      <link>https://dev.to/gittower/understanding-rebase-and-merge-in-git-4hcp</link>
      <guid>https://dev.to/gittower/understanding-rebase-and-merge-in-git-4hcp</guid>
      <description>&lt;p&gt;While merging is definitely the easiest and most common way to integrate changes in Git, it's not the only one: "Rebase" is an alternative (and slightly advanced) means of integration.&lt;/p&gt;



&lt;h2&gt;
  
  
  The Case Against Merge Commits
&lt;/h2&gt;

&lt;p&gt;A normal commit, carefully created by a human being, is a meaningful unit: it wraps only related changes and annotates them with a comment.&lt;/p&gt;

&lt;p&gt;All this gets lost in a &lt;strong&gt;merge commit&lt;/strong&gt;: it's created automatically by Git to cram in all the differing changes. It has no semantic meaning, no separation of topics. Of course, the contents of those individual commits are preserved. But the history - commented and nicely separated into individual, meaningful commits - that lead to this point is not preserved in a merge commit.&lt;/p&gt;

&lt;p&gt;This is why some people dislike merging and instead use rebase.&lt;/p&gt;



&lt;h2&gt;
  
  
  The Beauty of Rebase
&lt;/h2&gt;

&lt;p&gt;Instead of cramming all changes into a merge commit, a rebase preserves the original commits. The project's history then looks as if it had evolved in a single, straight line. No indication remains that it had been split into multiple branches at some point.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwzasove9v5z5r0pn0reo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwzasove9v5z5r0pn0reo.png" alt="end-situation-for-rebase"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's walk through a rebase operation step by step. The scenario is simple: we want to integrate the changes from branch-B into branch-A, using rebase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9d8262uevu4v0o2xjbk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9d8262uevu4v0o2xjbk5.png" alt="starting-situation-before-rebase"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command for this is very easy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git rebase branch-B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




 

&lt;p&gt;First, Git will "undo" all commits on branch-A that happened after the lines began to branch out (after the common ancestor commit). Of course, it won't discard them but rather save them away, temporarily.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdod6ppzw8ujwvp50ctet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdod6ppzw8ujwvp50ctet.png" alt="rebase-step-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, it applies the commits from branch-B that we want to integrate. At this point, both branches look exactly the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1abhyof3ctlehgjjc94.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1abhyof3ctlehgjjc94.png" alt="rebase-step-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the final step, the new commits on branch-A are now reapplied - but on a new position, on top of the integrated commits from branch-B (they are &lt;em&gt;re-based&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;The result looks like development had happened in a straight line. Instead of a merge commit that contains all the combined changes, the original commit structure was preserved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq2pl44eewqqzigpg1acu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq2pl44eewqqzigpg1acu.png" alt="rebase-step-3"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;In case you're using the &lt;a href="https://www.git-tower.com/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-rebase-merge-in-git" rel="noopener noreferrer"&gt;Tower Git GUI&lt;/a&gt;, you can use rebase simply by dragging the to-be-integrated branch and dropping it on the target branch, with the ALT key pressed. That's it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fscsj5ziezfos1nnivk2j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fscsj5ziezfos1nnivk2j.gif" alt="rebase-in-tower"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Learn More
&lt;/h2&gt;

&lt;p&gt;Of course, there's a lot more to know and understand about rebase in Git! If you want to learn more, have a look at the chapter "&lt;a href="http://git-tower.com/learn/git/ebook/en/desktop-gui/advanced-topics/rebase/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-rebase-merge-in-git" rel="noopener noreferrer"&gt;Rebase as an Alternative to Merge&lt;/a&gt;" in my &lt;strong&gt;free&lt;/strong&gt; online book on "&lt;em&gt;Learning Version Control with Git&lt;/em&gt;".&lt;/p&gt;

&lt;p&gt;&lt;a href="http://git-tower.com/learn/git/ebook/en/desktop-gui/advanced-topics/rebase/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=understanding-rebase-merge-in-git" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdoqwrx4awh5pv48pc9ac.png" alt="ebook-learn-version-control"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>12 Ways to Undo Mistakes with Git - Part 2</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 06 Oct 2020 17:26:30 +0000</pubDate>
      <link>https://dev.to/gittower/12-ways-to-undo-mistakes-with-git-part-2-1l01</link>
      <guid>https://dev.to/gittower/12-ways-to-undo-mistakes-with-git-part-2-1l01</guid>
      <description>&lt;p&gt;Accidentally deleting files... Making typos in your commit messages... Committing on the wrong branch... a lot of mistakes happen when humans write code! But do not despair: Git offers countless tools to undo and recover from small and big mishaps.&lt;/p&gt;

&lt;p&gt;In this second part, you'll find another set of 6 short &amp;amp; handy videos that help you undo mistakes with Git! &lt;em&gt;(&lt;a href="https://dev.to/gittower/12-ways-to-undo-mistakes-with-git-part-1-4bmn"&gt;Take a look at part 1&lt;/a&gt; if you missed it!)&lt;/em&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Resetting a File to an Old Revision
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Yikes! 🤔 I know this file was correct sometime!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Not everything was better in the old days! Just this one particular file, that you now long to restore from a previous revision. Here's how!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PEXPbscUle4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Recovering Deleted Commits
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Sweet baby Jesus! 😱 Did I just delete the wrong commits?!!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Using "git reset" is a wonderful way to get rid of some unwanted commits. But it's also a wonderful way to get yourself into trouble - if you got rid of the wrong commits! But chin up! You can undo even that!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/1NpZKyLENoc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Moving a Commit to a New Branch
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Damn it! 😣 I should have created a new branch before committing!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; You've worked busily on a new feature and solemnly made the first commit - although you haven't created a separate feature branch for it. Let's get that new feature commit off of the "master" branch and move it to its own feature branch!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/yOJ94iIOg9g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Editing Old Commit Messages
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Christ on a cracker! 😱 Did I write this commit message?!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Sometimes you hit RETURN and notice instantly that you just made a typo in your commit message. No problem: Git's "amend" feature is here to help! Other times, however, it takes days and weeks before you notice your spelling mistakes - and yet there's still a way to save your good reputation!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UOVSZEHUHFo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Deleting Old Commits
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Knock me over with a feather! 🤔 Did I create that commit?!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Buried deep inside your commit history, there's a commit that just shouldn't be there. Let's make it look like it never happened!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JI8jxrvMWSI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Squashing Multiple Commits Into One
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Holy cow! 🐮 Why did I create so many commits??"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Committing in small, granular doses is actually a virtue. But of course there can be "too much of a good thing". If you've overdone it and want to combine multiple commits into one: here's how!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-ToF4P7AjBU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;It's probably quite obvious by now: &lt;strong&gt;Git is an excellent safety net!&lt;/strong&gt; You can undo and repair almost anything! The tricky part is mostly just knowing the corresponding workflows and commands.&lt;/p&gt;

&lt;p&gt;To help your memory, you can &lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;download all 12 cases + &lt;strong&gt;5 extra episodes and 1 cheat sheet&lt;/strong&gt;&lt;/a&gt; as part of my free &lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;"First Aid Kit for Git"&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9gfafqhh1d8rqgznrjj.png" alt="first-aid-kit"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  About the Author
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/gntr" rel="noopener noreferrer"&gt;Tobias Günther&lt;/a&gt; is the CEO of &lt;a href="https://www.git-tower.com/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;Tower&lt;/a&gt;, the popular Git desktop client that helps more than 100,000 developers around the world to be more productive with Git.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>webdev</category>
    </item>
    <item>
      <title>12 Ways to Undo Mistakes with Git - Part 1</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 29 Sep 2020 15:30:49 +0000</pubDate>
      <link>https://dev.to/gittower/12-ways-to-undo-mistakes-with-git-part-1-4bmn</link>
      <guid>https://dev.to/gittower/12-ways-to-undo-mistakes-with-git-part-1-4bmn</guid>
      <description>&lt;p&gt;Accidentally deleting files... Making typos in your commit messages... Committing on the wrong branch... a lot of mistakes happen when humans write code! But do not despair: Git offers countless tools to undo and recover from small and big mishaps.&lt;/p&gt;

&lt;p&gt;In this first part, you'll find 6 short &amp;amp; handy videos that help you learn how to save your neck! &lt;em&gt;(Stay tuned for the second part with the remaining 6 cases!)&lt;/em&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Discarding All Local Changes in a File
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Oh my goodness! 🤔 When did I write that?!!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Let's not sugarcoat this: you've had better days. You've worked on a certain file and wish you hadn't. But at least, you haven't committed your changes yet - so let's go ahead and discard all local changes in that file!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Scuxvc22nyE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Discarding Chunks / Lines in a File
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Mama mia! 🙄 Was that me?!!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; It's not that you messed up completely. It's just that some parts of your changes aren't as brilliant as they seemed at first. That's no reason to throw the baby out with the bath water: let's keep the changes that make sense and discard those that don't!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tVlzUHdFRNo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Discarding All Local Changes
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Bloody hell! 🙈 Let’s start over!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; You had a feeling this morning, and it was correct: you should have stayed in bed. Because you clearly coded yourself into a dead-end street. So let's just discard all uncommitted work and return the project to its last committed state.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/yjntstLz0qI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Fixing the Last Commit
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Holy moly! 😤 Too quick with that commit…"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Word is on the street that you commit faster than your shadow. While you normally take that as a compliment, in this case it's more of a problem: because you littered the last commit's message with typos. Let's clean this up and make it so that no one ever hears about this!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/BhZYNfxGDAg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Reverting a Commit in the Middle
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Deary me! 😩 How can I get rid of that commit?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; Recently, it became clear that you and your old friend, commit a4f780b, don't get along so well anymore. Unfortunately, he's been in your code base for quite a while now. So instead of "deleting" him from your commit history, let's neutralize him in a friendly way: by creating a new commit that reverts his effects!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/SS4W8WbiaCE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Resetting to an Old Revision
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Apply in cases of:&lt;/strong&gt; &lt;em&gt;"Good gravy! 😖 I wish I could turn back time…"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disaster summary:&lt;/strong&gt; There was a time when everything was wonderful in your repository, when everything worked. Here's to these good old days! Luckily, you can turn back time and reset your project to an old revision.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JTjoaH-kkGc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;It's probably quite obvious by now: &lt;strong&gt;Git is an excellent safety net!&lt;/strong&gt; You can undo and repair almost anything! The tricky part is mostly just knowing the corresponding workflows and commands.&lt;/p&gt;

&lt;p&gt;In the second part of this little series, I'll show you 6 more cases.&lt;/p&gt;

&lt;p&gt;If you don't want to wait, you can &lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;download all 12 cases + &lt;strong&gt;5 extra episodes and 1 cheat sheet&lt;/strong&gt;&lt;/a&gt; as part of my free &lt;strong&gt;&lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;"First Aid Kit for Git"&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9gfafqhh1d8rqgznrjj.png" alt="first-aid-kit"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  About the Author
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/gntr" rel="noopener noreferrer"&gt;Tobias Günther&lt;/a&gt; is the CEO of &lt;a href="https://www.git-tower.com/?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=12-ways-to-undo-mistakes" rel="noopener noreferrer"&gt;Tower&lt;/a&gt;, the popular Git desktop client that helps more than 100,000 developers around the world to be more productive with Git.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>8 Reasons Why Git is so Popular</title>
      <dc:creator>Tobias Günther</dc:creator>
      <pubDate>Tue, 15 Sep 2020 07:11:27 +0000</pubDate>
      <link>https://dev.to/gittower/8-reasons-why-git-is-so-popular-3mj4</link>
      <guid>https://dev.to/gittower/8-reasons-why-git-is-so-popular-3mj4</guid>
      <description>&lt;p&gt;When it comes to version control, everybody is talking about Git these days. But because it has become a standard, it's often adapted blindly - without knowing why exactly Git is superior to other systems like Subversion, Mercurial, or CVS. Even if you're already using Git, I think it's good to understand what makes Git great. &lt;/p&gt;

&lt;p&gt;Read on for some hard (and soft) facts about why Git has become so popular.&lt;/p&gt;



&lt;h2&gt;
  
  
  1. Save Time
&lt;/h2&gt;

&lt;p&gt;Imagine that, every time before moving your mouse, you’d have to wait for 5 seconds. Pretty annoying, right? With version control it’s quite the same – we’re also only talking about a few seconds per command, but it quickly adds up in your work day. Git, however, is lightning fast. Use your time for something more useful than waiting for your version control system to get back to you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9njdvwuwryfibacz7x4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9njdvwuwryfibacz7x4b.png" alt="git_performance"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  2. Work Offline
&lt;/h2&gt;

&lt;p&gt;What if you want to work while you’re on the move? With a centralized VCS like Subversion or CVS, you’re stranded if you’re not connected to the central repository. With Git, almost everything is possible simply on your local machine: make a commit, browse your project’s complete history, merge or create branches… Git lets you decide where and when you want to work.  &lt;/p&gt;



&lt;h2&gt;
  
  
  3. Undo Mistakes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6fj1ubp8cci9wjuvljy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6fj1ubp8cci9wjuvljy.png" alt="diagrams-illustrations.004"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes I make mistakes (it was a shocking discovery for me, too!). What I love about Git is that there’s a little “undo” command for almost every situation. Correct your last commit because you forgot to include that small change. Revert a whole commit because that feature isn’t necessary, anymore. And when the going gets tough you can even restore “deleted” commits with the Reflog – because, behind the scenes, Git rarely really deletes anything. This is peace of mind.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to &lt;strong&gt;learn how to undo your mistakes with Git&lt;/strong&gt;, take a look at the free &lt;strong&gt;&lt;a href="http://git-tower.com/learn/git/first-aid-kit?utm_source=devto&amp;amp;utm_medium=guestpost&amp;amp;utm_campaign=8-reasons-for-git" rel="noopener noreferrer"&gt;First Aid Kit for Git&lt;/a&gt;&lt;/strong&gt;, a series of short videos that teach you how to save your neck using Git.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;h2&gt;
  
  
  4. Sleep Easy
&lt;/h2&gt;

&lt;p&gt;Have you ever smashed a Subversion repository? I have (and I say this with the associated headache still in vivid memory…). With Git, I can be totally confident because every clone that someone on the team has on their machine is a usable backup. Additionally, almost every action in Git only adds data (deleting is very rare). That makes it pretty hard to really screw things up. And this is a good feeling.&lt;/p&gt;



&lt;h2&gt;
  
  
  5. Make Useful Commits
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fupt0ebvcg50a1pxeabxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fupt0ebvcg50a1pxeabxw.png" alt="diagrams-illustrations.003"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are (at least) two problems when throwing milk, ice cream, and a tomato into a blender. First, after switching it on, no one can tell what you actually put in from looking at this mess. And second, you can’t “roll back” the tomato. The same holds true if you commit a bunch of unrelated changes (a little bit of feature A, something from feature B, a nice little bugfix, …). It’s hard for your teammates to understand what happened and they cannot easily roll back feature A if it causes problems. Git helps you to avoid this mess and create granular commits. With its unique “staging area” concept you can determine exactly which changes shall be included in your next commits, even down to single lines. This is where version control starts to be useful.&lt;/p&gt;



&lt;h2&gt;
  
  
  6. Work in Your Own Way
&lt;/h2&gt;

&lt;p&gt;When working with Git you can use your very own workflow. One that feels good for you. You don’t have to be a code acrobat to qualify for using Git. Of course, you can connect with multiple remote repositories, rebase instead of merge, and work with submodules when you need it. But you can just as easily work with one central remote repository like in Subversion. All the other advantages remain – regardless of your workflow.&lt;/p&gt;



&lt;h2&gt;
  
  
  7. Don’t Mix Things Up
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc1v591bwropft3o94d5c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc1v591bwropft3o94d5c.png" alt="diagrams-illustrations.002"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Separation of concerns is paramount to keeping track of things. While you’re working on feature A, nothing (and no-one) else should be affected by your unfinished code. What if it turns out the feature isn’t necessary anymore? Or if, after 10 commits, you notice that you took the completely wrong approach? Branching is the answer for these problems. And while other version control systems also know branches, Git is the only one to make it work as it should: fast &amp;amp; easy.  &lt;/p&gt;



&lt;h2&gt;
  
  
  8. Go With the Flow
&lt;/h2&gt;

&lt;p&gt;Only dead fish swim with the stream. And sometimes, clever developers do, too. Git is used by more and more well-known companies and Open Source projects: Ruby On Rails, jQuery, Perl, Debian, the Linux Kernel and many more. A large community often is an advantage by itself because an ecosystem evolves around the system. From code hosting platforms like &lt;a href="http://github.com" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and &lt;a href="https://about.gitlab.com" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;, to GUI tools like &lt;a href="https://www.git-tower.com" rel="noopener noreferrer"&gt;Tower&lt;/a&gt; all the way to tutorials and documentation: everything you need is already there!&lt;/p&gt;



&lt;h2&gt;
  
  
  Take Your Git Skills to the Next Level
&lt;/h2&gt;

&lt;p&gt;Git can add tremendous value to your development workflow. But only if you go beyond the basic "commit, pull, push"! &lt;/p&gt;

&lt;p&gt;There are lots of &lt;a href="https://www.git-tower.com/learn/" rel="noopener noreferrer"&gt;free tutorials on Git&lt;/a&gt; available - you only have to invest a bit of your time to become a better developer.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
