<?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: Javi Palacios</title>
    <description>The latest articles on DEV Community by Javi Palacios (@fj_palacios).</description>
    <link>https://dev.to/fj_palacios</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3958394%2F53300b47-6c71-4239-a646-2a8cc4b00d1e.jpeg</url>
      <title>DEV Community: Javi Palacios</title>
      <link>https://dev.to/fj_palacios</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fj_palacios"/>
    <language>en</language>
    <item>
      <title>Push and fetch in Git: syncing with the remote</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Thu, 25 Jun 2026 08:48:11 +0000</pubDate>
      <link>https://dev.to/fj_palacios/push-and-fetch-in-git-syncing-with-the-remote-10no</link>
      <guid>https://dev.to/fj_palacios/push-and-fetch-in-git-syncing-with-the-remote-10no</guid>
      <description>&lt;p&gt;You already know that remotes are aliases for URLs, and that &lt;code&gt;origin&lt;/code&gt; has nothing special about it. But having the remote configured isn't enough — the whole point is to synchronize your work with it. When do you use &lt;code&gt;git push&lt;/code&gt;? When do you use &lt;code&gt;git fetch&lt;/code&gt;? And what exactly is the difference between &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt;? There are people who've been using Git for years without having this fully clear (no judgment — me included when I started).&lt;/p&gt;

&lt;p&gt;Let's fix that today, and along the way we'll see why &lt;code&gt;git push --force&lt;/code&gt; is one of the most efficient ways to make your teammates hate you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending changes to the remote: git push
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt; sends your local commits to a remote repository. The basic form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sends the local &lt;code&gt;master&lt;/code&gt; branch to the &lt;code&gt;origin&lt;/code&gt; remote. If the remote doesn't have that branch yet, it creates it. If it already exists and your commits are a direct continuation of its history (no divergence), the push works without issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting the upstream with -u
&lt;/h3&gt;

&lt;p&gt;The first time you push a new branch, add &lt;code&gt;-u&lt;/code&gt; to set up tracking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, from that branch you can just type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Git already knows where to go. Without &lt;code&gt;-u&lt;/code&gt;, Git will ask you to specify the remote and branch every time, with an error message that a lot of people copy into Google without reading it in full.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens when a push is rejected?
&lt;/h3&gt;

&lt;p&gt;If someone else pushed changes to the same branch while you were working, you'll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt; ! [rejected]        master -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;master &lt;span class="o"&gt;(&lt;/span&gt;fetch first&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;error: failed to push some refs to 'git@github.com:youruser/my-project.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git refuses to overwrite someone else's work. The fix: bring in the remote changes first, integrate them, then push. We'll cover this in detail in the next section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Receiving changes: fetch vs pull
&lt;/h2&gt;

&lt;p&gt;This is where confusion is most common. There are two ways to bring changes from the remote:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git fetch&lt;/code&gt;: downloads the changes but &lt;strong&gt;doesn't apply them&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git pull&lt;/code&gt;: downloads the changes &lt;strong&gt;and applies them&lt;/strong&gt; (it's &lt;code&gt;fetch&lt;/code&gt; + &lt;code&gt;merge&lt;/code&gt; in one shot)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  git fetch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This updates your local remote references (&lt;code&gt;origin/master&lt;/code&gt;, &lt;code&gt;origin/develop&lt;/code&gt;, etc.) with what's on the server, but &lt;strong&gt;doesn't touch your working branch&lt;/strong&gt;. It's like checking your mail without opening it.&lt;/p&gt;

&lt;p&gt;After a fetch, you can see what changed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log master..origin/master &lt;span class="nt"&gt;--oneline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a7f3c21 Fix authentication bug
b2e9d14 Add user profile endpoint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That shows you the commits that are in &lt;code&gt;origin/master&lt;/code&gt; but not yet in your local &lt;code&gt;master&lt;/code&gt;. You can inspect them at your own pace before deciding to integrate them.&lt;/p&gt;

&lt;p&gt;When you're ready to integrate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge origin/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  git pull
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is equivalent to running &lt;code&gt;git fetch origin&lt;/code&gt; followed by &lt;code&gt;git merge origin/master&lt;/code&gt;. Faster to type, but it removes the intermediate inspection step.&lt;/p&gt;

&lt;p&gt;On personal projects or when you trust what's on the remote, &lt;code&gt;git pull&lt;/code&gt; is perfectly fine. On team projects with high activity, fetching first gives you more control over what you're integrating and when.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;fetch + manual merge      git pull
────────────────────      ─────────
git fetch origin     ←→   git pull origin master
git log master..origin/master
git merge origin/master
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Neither option is universally better. It comes down to how much you want to see before integrating.&lt;/p&gt;

&lt;h2&gt;
  
  
  The danger of --force
&lt;/h2&gt;

&lt;p&gt;When a push is rejected because the remote has changes you don't have, the temptation is to use &lt;code&gt;--force&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ⚠️ Dangerous on shared branches&lt;/span&gt;
git push &lt;span class="nt"&gt;--force&lt;/span&gt; origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--force&lt;/code&gt; overwrites the remote's history with yours, ignoring any commits that are there. If you're working alone on a feature branch that only you touch, it can be valid. On a shared branch, it's like deleting your teammates' work without asking.&lt;/p&gt;

&lt;h3&gt;
  
  
  --force-with-lease: the sensible alternative
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;--force-with-lease&lt;/span&gt; origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--force-with-lease&lt;/code&gt; does the same operation as &lt;code&gt;--force&lt;/code&gt;, but with a prior check: it fails if the remote has commits you don't have in your local copy. In other words, it protects you from overwriting someone else's work that you haven't seen.&lt;/p&gt;

&lt;p&gt;The practical difference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;--force&lt;/span&gt;            &lt;span class="c"&gt;# "Overwrite no matter what"&lt;/span&gt;
&lt;span class="nt"&gt;--force-with-lease&lt;/span&gt; &lt;span class="c"&gt;# "Overwrite only if the remote hasn't changed since my last fetch"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When do you use force (with lease)? The most common case is after a &lt;code&gt;git rebase&lt;/code&gt;: by rewriting history, your commits get new hashes and Git sees them as diverging from the remote, even though the content is essentially the same. If the branch is yours alone, &lt;code&gt;--force-with-lease&lt;/code&gt; is safe.&lt;/p&gt;

&lt;p&gt;On shared branches like &lt;code&gt;master&lt;/code&gt; or &lt;code&gt;main&lt;/code&gt;: never, except in very specific situations with explicit team coordination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical case: the full workflow
&lt;/h2&gt;

&lt;p&gt;A typical flow in a project where more than one person is working on the same branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Bring in the latest changes before starting&lt;/span&gt;
git fetch origin
git log master..origin/master &lt;span class="nt"&gt;--oneline&lt;/span&gt;  &lt;span class="c"&gt;# what's new?&lt;/span&gt;

&lt;span class="c"&gt;# 2. Integrate if there are changes&lt;/span&gt;
git merge origin/master

&lt;span class="c"&gt;# 3. Do your work and commit locally&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"feat: add search functionality"&lt;/span&gt;

&lt;span class="c"&gt;# 4. Before pushing, check if someone else pushed while you worked&lt;/span&gt;
git fetch origin
git log master..origin/master &lt;span class="nt"&gt;--oneline&lt;/span&gt;

&lt;span class="c"&gt;# 5. If there are new changes, integrate them first&lt;/span&gt;
git merge origin/master  &lt;span class="c"&gt;# or git rebase origin/master, depending on the project&lt;/span&gt;

&lt;span class="c"&gt;# 6. Now push&lt;/span&gt;
git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This looks like a lot of steps, but with practice it becomes automatic. And it prevents 90% of remote conflicts.&lt;/p&gt;




&lt;p&gt;With this you have the full cycle: you know how to send changes to the remote, how to receive them with control, and why &lt;code&gt;--force-with-lease&lt;/code&gt; exists (and bare &lt;code&gt;--force&lt;/code&gt; should give you pause).&lt;/p&gt;

&lt;p&gt;In the next tutorial, lesson 18, we'll look at how to undo commits: from minor fixes with &lt;code&gt;--amend&lt;/code&gt; to reverting already-pushed changes without breaking shared history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 Challenge&lt;/strong&gt;: In one of your repositories, run &lt;code&gt;git fetch origin&lt;/code&gt; and then &lt;code&gt;git log HEAD..origin/master --oneline&lt;/code&gt;. Are there commits on the remote that you don't have locally? If not, create a commit directly on GitHub and repeat the exercise. Then integrate with &lt;code&gt;git merge&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Obtaining and cloning new commits from a Git repository</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Tue, 23 Jun 2026 09:42:46 +0000</pubDate>
      <link>https://dev.to/fj_palacios/obtaining-and-cloning-new-commits-from-a-git-repository-27bf</link>
      <guid>https://dev.to/fj_palacios/obtaining-and-cloning-new-commits-from-a-git-repository-27bf</guid>
      <description>&lt;p&gt;Yay! We have our &lt;a href="https://dev.to/en/tutorials/creating-our-first-repository-on-github"&gt;fancy fresh baked repo on GitHub&lt;/a&gt;, now let's face our main purpose of working with a remote &lt;em&gt;server&lt;/em&gt;: Allowing as many people as you need to work on your project indepently from their locations. For simulating this scenario, instead of working from two different machines, we're going to create two folders. In our last article, we uploaded our project to the folder &lt;strong&gt;test&lt;/strong&gt; and as we are really original we are going to create another folder with the name &lt;strong&gt;test2&lt;/strong&gt;, which is going to act as our &lt;em&gt;second machine&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;When we see a repository on GitHub that we want to &lt;em&gt;copy&lt;/em&gt; to our computer, with a simple click on &lt;strong&gt;Clone or Download&lt;/strong&gt; &lt;em&gt;AND&lt;/em&gt; double checking that we &lt;em&gt;ticked&lt;/em&gt; the option to clone thru SSH (which is the recommended option and in a near future we will explain why) will copy the called project to our computer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ek2bbpkql2ivhrhbc1i.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ek2bbpkql2ivhrhbc1i.webp" alt="Cloning a repo from GitHub" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to copy the Git address we see in the text field and paste it onto our terminal with this command: &lt;code&gt;git clone git@github.com:fjpalacios/test.git test2&lt;/code&gt;&lt;br&gt;
As you can tell, &lt;strong&gt;test2&lt;/strong&gt; is the folder which we choose to &lt;em&gt;download&lt;/em&gt; the repo (by default, if we don't specify any folder, it would use &lt;em&gt;test&lt;/em&gt;, same as the name of our project).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Cloning into &lt;span class="s1"&gt;'test2'&lt;/span&gt;...
remote: Counting objects: 3, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Total 3 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, reused 3 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, pack-reused 0
Receiving objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;3/3&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's say another team member, or ourselves, from the other computer (&lt;strong&gt;test&lt;/strong&gt; folder), we do some changes, then, the other repository we just cloned is not up to date anymore!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"This is a test file"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test.txt
&lt;span class="nv"&gt;$ &lt;/span&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Adding a test file"&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt;master d40c331] Adding a &lt;span class="nb"&gt;test &lt;/span&gt;file
 1 file changed, 1 insertion&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 test.txt

&lt;span class="nv"&gt;$ &lt;/span&gt;git push origin master

Counting objects: 3, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Delta compression using up to 2 threads.
Compressing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;2/2&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Writing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;3/3&lt;span class="o"&gt;)&lt;/span&gt;, 957 bytes | 957.00 KiB/s, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Total 3 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, reused 0 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;
To github.com:fjpalacios/test.git
   9da799a..d40c331  master -&amp;gt; master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even if we think the file should be there, it isn't! Let's see the files in the current folder with &lt;code&gt;ls&lt;/code&gt; and as we said before, the file isn't there! There's only one file: &lt;strong&gt;README.md&lt;/strong&gt; which was the only file when we cloned the repo. Solving this won't take long, don't you worry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git pull origin master

remote: Counting objects: 3, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Compressing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;2/2&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Total 3 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, reused 3 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, pack-reused 0
Unpacking objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;3/3&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
From github.com:fjpalacios/test
 &lt;span class="k"&gt;*&lt;/span&gt; branch            master     -&amp;gt; FETCH_HEAD
   9da799a..d40c331  master     -&amp;gt; origin/master
Updating 9da799a..d40c331
Fast-forward
 test.txt | 1 +
 1 file changed, 1 insertion&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 test.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's re-check again with &lt;code&gt;ls&lt;/code&gt; and you are going to see the new file (or files, depending on how many files were in the other repo). When we are working on our own is not that complicated to know if we have changes in any of our machines, but when we are working as part of a team, that's tricky! That's why it's good to ask Git if &lt;em&gt;he has any changes for us&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;As an extra: If you're working on different branches and you want to pull all the changes from every branch, instead of specifying a specific branch, we would use &lt;strong&gt;--all&lt;/strong&gt; as a parameter: &lt;code&gt;git pull origin --all&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And this is it, Another part of the course! As always, never stop programming! Which, if you're with us since the start of this course, you can code with the peace of mind that your project is safe thanks to Git.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Working with Git Remotes</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Mon, 22 Jun 2026 12:15:51 +0000</pubDate>
      <link>https://dev.to/fj_palacios/working-with-git-remotes-1711</link>
      <guid>https://dev.to/fj_palacios/working-with-git-remotes-1711</guid>
      <description>&lt;p&gt;You've been typing &lt;code&gt;git push origin master&lt;/code&gt; for a while now. It works, the code lands on GitHub, everyone's happy. But if someone asked you right now what exactly &lt;code&gt;origin&lt;/code&gt; is, could you answer without hesitating? Or do you use it "on faith" — the kind of faith where you pray the command works and don't ask too many questions?&lt;/p&gt;

&lt;p&gt;Don't worry. Most people use Git for years without fully understanding what's behind that &lt;code&gt;origin&lt;/code&gt;. Let's fix that today.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does Git know about your remotes?
&lt;/h2&gt;

&lt;p&gt;A remote in Git is simply an &lt;strong&gt;alias for a URL&lt;/strong&gt;. That's it. &lt;code&gt;origin&lt;/code&gt; is not a mystical entity or a special server: it's a name pointing to an address, just like a contact in your phone has a name pointing to a number.&lt;/p&gt;

&lt;p&gt;To see which remotes you have configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;origin  git@github.com:youruser/my-project.git (fetch)
origin  git@github.com:youruser/my-project.git (push)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each remote appears twice: once for &lt;code&gt;fetch&lt;/code&gt; (receiving) and once for &lt;code&gt;push&lt;/code&gt; (sending). In almost every case they point to the same URL, but Git treats them independently. This lets you, in theory, fetch from one place and push to another — useful in weird setups you'll probably never need, but good to know exist.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;origin&lt;/code&gt; is the default name Git assigns when you run &lt;code&gt;git clone&lt;/code&gt;. There's nothing special about it. You could call it &lt;code&gt;github&lt;/code&gt;, &lt;code&gt;main-remote&lt;/code&gt;, or &lt;code&gt;potato&lt;/code&gt; and it would work exactly the same.&lt;/p&gt;

&lt;p&gt;If you only want the names without the URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding and removing remotes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding a remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add &amp;lt;name&amp;gt; &amp;lt;url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, to add a second remote called &lt;code&gt;backup&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add backup git@github.com:youruser/my-project-backup.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have two:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;backup  git@github.com:youruser/my-project-backup.git (fetch)
backup  git@github.com:youruser/my-project-backup.git (push)
origin  git@github.com:youruser/my-project.git (fetch)
origin  git@github.com:youruser/my-project.git (push)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Removing a remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote remove backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or its equivalent alias (because in Git there's always two ways to do the same thing):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nb"&gt;rm &lt;/span&gt;backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes only the local configuration — the remote repository on the server keeps existing, don't worry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Renaming a remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote rename origin github
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From that point you'd use &lt;code&gt;git push github master&lt;/code&gt; instead. Useful when you have multiple remotes and want more descriptive names than &lt;code&gt;origin&lt;/code&gt;, &lt;code&gt;origin2&lt;/code&gt;, and &lt;code&gt;origin-that-one-I-dont-know-what-it-does&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing a remote's URL
&lt;/h3&gt;

&lt;p&gt;If you originally cloned with HTTPS and now want to switch to SSH (so you stop typing your password every five minutes), you don't need to delete and re-add the remote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote set-url origin git@github.com:youruser/my-project.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the change was applied:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;origin  git@github.com:youruser/my-project.git (fetch)
origin  git@github.com:youruser/my-project.git (push)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Inspecting a remote in detail
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git remote -v&lt;/code&gt; gives you the URLs, but if you want a full picture of what's happening with a remote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote show origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;* remote origin
  Fetch URL: git@github.com:youruser/my-project.git
  Push  URL: git@github.com:youruser/my-project.git
  HEAD branch: master
  Remote branches:
    develop tracked
    master  tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local refs configured for 'git push':
    master pushes to master (up to date)
    develop pushes to develop (local out of date)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last part — &lt;code&gt;local out of date&lt;/code&gt; — is the important bit: before you start working on &lt;code&gt;develop&lt;/code&gt;, you already know someone pushed changes you don't have. Without this command, you'd find out after trying to push and getting a cryptic error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multiple remotes: origin and upstream
&lt;/h2&gt;

&lt;p&gt;The most common reason to have more than one remote is when you work with &lt;strong&gt;forks&lt;/strong&gt;. Say you want to contribute to an open source project — the Git project itself, or any library you use daily:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You fork the repository on GitHub (now you have your own copy at &lt;code&gt;youruser/project&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;You clone your fork: &lt;code&gt;git clone git@github.com:youruser/project.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git configures &lt;code&gt;origin&lt;/code&gt; pointing to &lt;strong&gt;your fork&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem: the original project keeps moving forward without you, and you need to bring those changes in periodically. For that you add the original repository as a second remote. The universal convention (that everyone follows so nobody goes crazy) is to call it &lt;code&gt;upstream&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add upstream git@github.com:original-author/project.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;origin    git@github.com:youruser/project.git (fetch)
origin    git@github.com:youruser/project.git (push)
upstream  git@github.com:original-author/project.git (fetch)
upstream  git@github.com:original-author/project.git (push)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The typical workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Bring in the latest changes from the original project&lt;/span&gt;
git fetch upstream

&lt;span class="c"&gt;# Integrate them into your main branch&lt;/span&gt;
git merge upstream/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;code&gt;origin&lt;/code&gt; stays as your fork. &lt;code&gt;upstream&lt;/code&gt; is read-only in practice — you won't have push permissions there, and even if you did, you shouldn't push directly to the original repository (that's what pull requests are for).&lt;/p&gt;

&lt;h2&gt;
  
  
  Tracking branches: the link between local and remote
&lt;/h2&gt;

&lt;p&gt;When you clone a repository or run &lt;code&gt;git push -u origin master&lt;/code&gt;, Git creates something called a &lt;strong&gt;tracking branch&lt;/strong&gt;: a reference that connects your local branch to its counterpart on the remote. This is what lets Git know where to send changes when you run &lt;code&gt;git push&lt;/code&gt; with no extra arguments.&lt;/p&gt;

&lt;p&gt;To see which tracking branches you have configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-vv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;* master  a3f8c21 [origin/master] Add form validation
  develop e1b9d44 [origin/develop: ahead 2] Integrate payments module
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In brackets you see the remote branch being tracked. &lt;code&gt;ahead 2&lt;/code&gt; means you have 2 local commits that aren't on the remote yet. Very useful before a &lt;code&gt;git push&lt;/code&gt; to know exactly what you're about to send.&lt;/p&gt;

&lt;p&gt;When you create a new branch and push it for the first time, you set up the tracking with &lt;code&gt;-u&lt;/code&gt; (short for &lt;code&gt;--set-upstream&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From that point on, &lt;code&gt;git push&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; from that branch work without extra arguments. If you forget the &lt;code&gt;-u&lt;/code&gt;, Git will politely remind you it doesn't know where to push — with an error message that a lot of developers copy into Google without reading it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical cases
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cleaning up references to deleted remote branches
&lt;/h3&gt;

&lt;p&gt;Over time, teammates delete branches on the remote after a merge, but those references keep showing up in your local as ghosts of branches past. To clean them up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch &lt;span class="nt"&gt;--prune&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or configure it globally so it happens automatically on every fetch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; fetch.prune &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I recommend enabling this. Having references to branches that no longer exist only creates confusion, especially in high-activity projects.&lt;/p&gt;




&lt;p&gt;Now you understand what's behind that &lt;code&gt;origin&lt;/code&gt; you'd been using without questioning. Remotes are aliases, not magic. You can add as many as you need, inspect them, change their URLs, and know exactly which tracking branches connect them to your local work.&lt;/p&gt;

&lt;p&gt;In the next tutorial we'll look at how to synchronize your repository with those remotes: &lt;code&gt;git clone&lt;/code&gt; to start from scratch with an existing repository, and &lt;code&gt;git pull&lt;/code&gt; to keep your local copy up to date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 Challenge&lt;/strong&gt;: Add a second remote to an existing repository (it can point to the same URL as &lt;code&gt;origin&lt;/code&gt;, just with a different name). Run &lt;code&gt;git remote show&lt;/code&gt; on both and compare the output. Then remove it. Bonus: enable &lt;code&gt;fetch.prune&lt;/code&gt; globally if you haven't already.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Operators and expressions in Python</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Sun, 21 Jun 2026 00:11:53 +0000</pubDate>
      <link>https://dev.to/fj_palacios/operators-and-expressions-in-python-57n</link>
      <guid>https://dev.to/fj_palacios/operators-and-expressions-in-python-57n</guid>
      <description>&lt;p&gt;You already know what variables are and how to store data in them. But having data stored without doing anything with it is like having ingredients in the fridge without cooking: it doesn't matter how great your tomatoes are if you don't know how to fry them.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;operators&lt;/strong&gt; come in: the symbols that tell Python what to do with the data it has. Adding numbers, comparing values, combining conditions... with operators is when the code starts doing genuinely interesting things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arithmetic operators: Python's calculator
&lt;/h2&gt;

&lt;p&gt;Let's start with the most intuitive part. Python understands basic math exactly as you'd expect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 13 — addition
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 7  — subtraction
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 30 — multiplication
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 3.3333... — division
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So far so normal. But Python has two operators you won't find on a regular calculator, and they're tremendously useful:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integer division&lt;/strong&gt; (&lt;code&gt;//&lt;/code&gt;): returns the quotient without decimals, discarding the remainder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 3
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Modulo&lt;/strong&gt; (&lt;code&gt;%&lt;/code&gt;): returns the remainder of the division. What's that good for? More than you'd think. For example, to check if a number is even (if the remainder of dividing by 2 is 0, it's even):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 1  (10 = 3×3 + 1)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 0  (8 is even, no remainder)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 1  (7 is odd)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, &lt;strong&gt;exponentiation&lt;/strong&gt; (&lt;code&gt;**&lt;/code&gt;), the coolest operator of them all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 1024  (2 to the power of 10)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 27    (3 cubed)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 3.0   (square root of 9)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that last one: &lt;code&gt;9 ** 0.5&lt;/code&gt; is the square root, because the square root is the same as raising to the power of 0.5. Python handles this perfectly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Order matters: operator precedence
&lt;/h2&gt;

&lt;p&gt;What do you think Python does with this?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you answered 20, the logic is impeccable but the answer is wrong. Python, just like in math class, follows the order of operations: multiplications and divisions first, then additions and subtractions. So the result is &lt;strong&gt;14&lt;/strong&gt; (3×4=12, then 2+12=14).&lt;/p&gt;

&lt;p&gt;What if you really want to add first? Parentheses work exactly the same as in school:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 20
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 14
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 8.0
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# 2.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The golden rule: &lt;strong&gt;when in doubt about order, use parentheses&lt;/strong&gt;. They cost nothing and make the code much easier to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison operators: is this greater than that?
&lt;/h2&gt;

&lt;p&gt;Here comes one of the points where beginners stumble most. Python has two symbols that look similar but do completely different things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;=&lt;/code&gt; is &lt;strong&gt;assignment&lt;/strong&gt;: stores a value in a variable&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;==&lt;/code&gt; is &lt;strong&gt;comparison&lt;/strong&gt;: checks if two values are equal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't mix them up. If you write &lt;code&gt;x = 5&lt;/code&gt; you're storing 5 in &lt;code&gt;x&lt;/code&gt;. If you write &lt;code&gt;x == 5&lt;/code&gt; you're asking "is &lt;code&gt;x&lt;/code&gt; equal to 5?", and Python answers &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True  — is x equal to 10?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# False — is x equal to 5?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# True  — is x different from 5?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# True  — is x greater than 5?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# False — is x less than 5?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True  — is x greater than or equal to 10?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True  — is x less than or equal to 10?
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of a comparison is always a &lt;strong&gt;boolean&lt;/strong&gt;: &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;. This is fundamental because later, when you get to conditionals (&lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt;), you'll be using these comparisons constantly to make decisions in your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logical operators: combining conditions
&lt;/h2&gt;

&lt;p&gt;What if a single comparison isn't enough? Imagine you want to know if someone can enter a website: they need to be over 18 &lt;strong&gt;and&lt;/strong&gt; have accepted the terms. Or maybe you want to know if a number is between 1 and 10.&lt;/p&gt;

&lt;p&gt;That's what logical operators are for: &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, and &lt;code&gt;not&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  and: both conditions must be met
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;accepted_terms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;accepted_terms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# True — meets both
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;accepted_terms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# False — terms not accepted
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True — x is between 1 and 10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  or: just one condition needs to be met
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;is_admin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;is_moderator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;is_admin&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;is_moderator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True — one is enough
&lt;/span&gt;
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Saturday&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Saturday&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sunday&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True — it's the weekend
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  not: inverts the result
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;has_account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;has_account&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True — if they DON'T have an account...
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;not&lt;/code&gt; is like putting a "no" in front: it turns &lt;code&gt;True&lt;/code&gt; into &lt;code&gt;False&lt;/code&gt; and vice versa.&lt;/p&gt;

&lt;p&gt;A very common combination in real code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;user_active&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;account_locked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="n"&gt;can_access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user_active&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;account_locked&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;can_access&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it out loud: "the user can access if they're active &lt;strong&gt;and&lt;/strong&gt; their account is &lt;strong&gt;not&lt;/strong&gt; locked". That's how natural well-written code reads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Assignment operators: updating variables without repeating yourself
&lt;/h2&gt;

&lt;p&gt;Imagine you have a counter and you want to add 1 to it. The obvious way would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works, but Python has a more compact form. The &lt;code&gt;+=&lt;/code&gt; operator adds and assigns in a single step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;   &lt;span class="c1"&gt;# equivalent to: counter = counter + 1
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 1
&lt;/span&gt;
&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;   &lt;span class="c1"&gt;# equivalent to: counter = counter + 5
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# 6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same exists for all other operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;    &lt;span class="c1"&gt;# x = 10 + 3 = 13
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;    &lt;span class="c1"&gt;# x = 13 - 2 = 11
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;    &lt;span class="c1"&gt;# x = 11 * 4 = 44
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;    &lt;span class="c1"&gt;# x = 44 / 2 = 22.0
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;//=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;   &lt;span class="c1"&gt;# x = 22.0 // 3 = 7.0
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;**=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;   &lt;span class="c1"&gt;# x = 7.0 ** 2 = 49.0
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;   &lt;span class="c1"&gt;# x = 49.0 % 10 = 9.0
&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 9.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see these operators constantly in loops (&lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;) when you need to accumulate values or count iterations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it all together: a simple calculator
&lt;/h2&gt;

&lt;p&gt;Let's write something that uses everything we've seen. A small calculator that analyzes two numbers and tells us various things about them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;

&lt;span class="c1"&gt;# Arithmetic operations
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; + &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; * &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; / &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; // &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; % &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ** &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Comparisons
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &amp;gt; &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;? &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; == &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;? &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Is 'a' even?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; even? &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Are both between 1 and 100?
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Both between 1 and 100? &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;15 + 4 = 19
15 - 4 = 11
15 * 4 = 60
15 / 4 = 3.75
15 // 4 = 3
15 % 4 = 3
15 ** 4 = 50625
Is 15 &amp;gt; 4? True
Is 15 == 4? False
Is 15 even? False
Both between 1 and 100? True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that &lt;code&gt;1 &amp;lt;= a &amp;lt;= 100&lt;/code&gt;: Python allows chaining comparisons this natural way, something that in many other languages you can't do directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The most classic mistake: = instead of ==
&lt;/h2&gt;

&lt;p&gt;Before you close this tutorial, burn this into your memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This ASSIGNS the value 5 to x (does not compare)
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="c1"&gt;# This COMPARES whether x is equal to 5
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you try to use &lt;code&gt;=&lt;/code&gt; where &lt;code&gt;==&lt;/code&gt; should go in a comparison, Python will throw an error (or worse, do something unexpected without warning). It's the most common mistake among Python beginners, so watch out for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;With operators you can now make your code take decisions and perform real calculations. What we've covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arithmetic&lt;/strong&gt; (&lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;//&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt;, &lt;code&gt;**&lt;/code&gt;): for doing calculations with numbers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparison&lt;/strong&gt; (&lt;code&gt;==&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;=&lt;/code&gt;, &lt;code&gt;&amp;lt;=&lt;/code&gt;): for comparing values and getting &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logical&lt;/strong&gt; (&lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt;): for combining multiple conditions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compound assignment&lt;/strong&gt; (&lt;code&gt;+=&lt;/code&gt;, &lt;code&gt;-=&lt;/code&gt;, &lt;code&gt;*=&lt;/code&gt;, etc.): for updating variables concisely&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Precedence&lt;/strong&gt;: parentheses win, then &lt;code&gt;**&lt;/code&gt;, then &lt;code&gt;*&lt;/code&gt; &lt;code&gt;/&lt;/code&gt; &lt;code&gt;//&lt;/code&gt; &lt;code&gt;%&lt;/code&gt;, and finally &lt;code&gt;+&lt;/code&gt; &lt;code&gt;-&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next tutorial we'll dive into &lt;strong&gt;strings&lt;/strong&gt;: how to create them, manipulate them, and get the most out of Python's string methods.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Creating our first repository on GitHub</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Sat, 20 Jun 2026 10:11:48 +0000</pubDate>
      <link>https://dev.to/fj_palacios/creating-our-first-repository-on-github-55ng</link>
      <guid>https://dev.to/fj_palacios/creating-our-first-repository-on-github-55ng</guid>
      <description>&lt;p&gt;We have already worked a lot with Git locally, we have seen how to create repositories, how to create commits, how to work with branches, how to recover files...&lt;/p&gt;

&lt;p&gt;But, how can I work with other people?, how do I share that great project that I just finished and I want more people to see it?, or the solution to that problem that half the world is encountering?&lt;/p&gt;

&lt;p&gt;For that, we have &lt;strong&gt;GitHub&lt;/strong&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitHub?
&lt;/h2&gt;

&lt;p&gt;Well, basically GitHub is a website where you can have your Git repositories, but not just any website, but &lt;strong&gt;the website par excellence&lt;/strong&gt; with more than 20 million users according to data from April 2017, and with more than 57 million repositories.&lt;/p&gt;

&lt;p&gt;Not bad, right?&lt;/p&gt;

&lt;p&gt;So let's see how to create our first repository on GitHub. The first thing we must do if we haven't already is to &lt;a href="https://github.com/join?source=header-home" rel="noopener noreferrer"&gt;create a GitHub account&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating our repository
&lt;/h2&gt;

&lt;p&gt;Once we have logged into our GitHub account, we will see the &lt;strong&gt;Dashboard&lt;/strong&gt;, which is the main page of GitHub, like that of any other social network, where we can see the activity of the people we follow or the repositories we have subscribed to.&lt;/p&gt;

&lt;p&gt;But well, let's get to what interests us, &lt;strong&gt;creating our first repository&lt;/strong&gt;. To do this, in the upper right corner we will see our avatar, and next to it a &lt;strong&gt;+&lt;/strong&gt; symbol, click on it and then &lt;strong&gt;New repository&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0b2vasizi9h5xs6ik416.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0b2vasizi9h5xs6ik416.webp" alt="New repository on GitHub" width="799" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that it will take us to the following page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flwyg6siixssgp2m5k9vx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flwyg6siixssgp2m5k9vx.webp" alt="Creating repository on GitHub" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see, we have several fields to fill in, below I will explain what each of them is for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository name&lt;/strong&gt;: the name of our repository, it is something that &lt;strong&gt;we must fill in yes or yes&lt;/strong&gt;, without that field it will not allow us to create the repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: a description of what our project consists of, it is not mandatory to fill it in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public/Private&lt;/strong&gt;: do we want our repository to be public for everyone or private only for us (or people we invite)? It is paid to be able to have private repositories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Initialize this repository with a README&lt;/strong&gt;: do we want a README file to be automatically created when the repository is created (which is the one we will use to describe what the project is about)?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add .gitignore&lt;/strong&gt;: do we want to add a .gitignore file? We can choose what language we are going to use in the project to add a standard .gitignore file of the language/framework we want (we can modify it later).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add a license&lt;/strong&gt;: do we want to add a license to our project? We can choose from the most popular ones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We fill in the &lt;strong&gt;Repository name&lt;/strong&gt; field, choose whether we want the repository to be public or private, check the &lt;strong&gt;Initialize this repository with a README&lt;/strong&gt; checkbox and click on &lt;strong&gt;Create repository&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After a few seconds it will take us to our repository page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiqfawsw9z0e5wio4clwv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiqfawsw9z0e5wio4clwv.webp" alt="Our new GitHub repository" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where we can see everything related to our project.&lt;/p&gt;

&lt;p&gt;At first we will see several things, such as the &lt;strong&gt;README.md&lt;/strong&gt; file that we have created (which is the one we see below the files), and the &lt;strong&gt;.gitignore&lt;/strong&gt; if we have created it too.&lt;/p&gt;

&lt;p&gt;Also, if we click on &lt;strong&gt;1 commit&lt;/strong&gt;, we can see the only commit we have so far, which is the initialization of the two files:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvjobuz1i8fpr3zybr4rb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvjobuz1i8fpr3zybr4rb.webp" alt="GitHub repository created" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, GitHub repositories also have &lt;strong&gt;branches&lt;/strong&gt;, in the previous screenshot we can see that the &lt;strong&gt;master&lt;/strong&gt; branch is shown, which is the one we have by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We have already seen how easy it is to create a repository on GitHub. In future tutorials we will see how to interact with it, how to download it to work locally, and a thousand more things.&lt;/p&gt;

&lt;p&gt;Never stop programming!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Getting started with Git remotes</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Fri, 19 Jun 2026 10:08:19 +0000</pubDate>
      <link>https://dev.to/fj_palacios/getting-started-with-git-remotes-3agg</link>
      <guid>https://dev.to/fj_palacios/getting-started-with-git-remotes-3agg</guid>
      <description>&lt;p&gt;Like we already explained in our first article for this course &lt;a href="https://dev.to/en/tutorials/what-is-git/"&gt;What is Git?&lt;/a&gt;: Git is a decentralized service, you won't find the typical &lt;em&gt;client-server&lt;/em&gt; kind of structure but with &lt;strong&gt;remotes&lt;/strong&gt; we can emulate this method to which all of us are so used to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remotes… What the heck are they?
&lt;/h3&gt;

&lt;p&gt;As soon as we hear &lt;em&gt;Remote&lt;/em&gt;, our mind flies to &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or &lt;a href="https://gitlab.com/" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;, which are perfect to emulate the mentioned structure and not only that, they are a great &lt;em&gt;showroom&lt;/em&gt; for Open Source projects.&lt;/p&gt;

&lt;p&gt;A remote basically is another node where we can send data or where we can receive data from, another pc on our network, a colleague's pc or our company's main server.&lt;/p&gt;

&lt;p&gt;Remote servers are in other terms a place where we can save a Backup (and many other things :P) exact same the way we have the data on our computers, but probably the most brighter side is when we are sending code to a service like GitHub or GitLab, takes out work from our side, as automatizes some tedious tasks, which cause serious time loss and nerves (above the sky!) and are (sometimes) the most hated tasks by devops like us. Executing our test battery for the new-ly sent code to GitHub is a perfect idea to make sure not even a single bracket is missing the closure or a function has stopped working since the implemented a new greeting method and the best of all, doing this is free! So why not give it a chance?&lt;/p&gt;

&lt;h3&gt;
  
  
  This this this is everything friends??
&lt;/h3&gt;

&lt;p&gt;Nope, we are bringing more stuff about Git and the use of remotes in our following articles for this course.&lt;/p&gt;

&lt;p&gt;And a quick reminder, all the code we are sharing with you is available in our &lt;a href="https://github.com/sargantanacode/git-tutorial" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt; where you can access it and have an idea how Git works from a remote node perspective.&lt;/p&gt;

&lt;p&gt;Meanwhile, as we always say… Never stop programming!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Installing Neovim and LazyVim</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Thu, 18 Jun 2026 13:20:04 +0000</pubDate>
      <link>https://dev.to/fj_palacios/installing-neovim-and-lazyvim-3dim</link>
      <guid>https://dev.to/fj_palacios/installing-neovim-and-lazyvim-3dim</guid>
      <description>&lt;p&gt;You're convinced: you want to try Vim. You understand the philosophy of modal editing, you know it can make you more productive, and you're ready to take the leap. But there's one small problem: &lt;strong&gt;how the hell do I install this thing?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're like me when I started, you've probably heard of Vim, Neovim, NeoVim nightly, Vim 9.0, LazyVim, LunarVim, NvChad... What is each thing? Where do I start? Is my computer going to explode?&lt;/p&gt;

&lt;p&gt;Relax. We're going to install &lt;strong&gt;Neovim&lt;/strong&gt; (the modern version of Vim) with &lt;strong&gt;LazyVim&lt;/strong&gt; (a preconfigured setup that gives you a modern IDE from minute zero). And we're going to do it step by step, without assuming you have a PhD in Unix systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Neovim or Vim? The eternal question
&lt;/h2&gt;

&lt;p&gt;Before installing anything, let's clear up the confusion: &lt;strong&gt;Vim&lt;/strong&gt; is the classic editor, created by Bram Moolenaar in 1991. &lt;strong&gt;Neovim&lt;/strong&gt; is a modern fork of Vim (since 2014) that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Has better support for modern plugins (written in Lua)&lt;/li&gt;
&lt;li&gt;Supports LSP (Language Server Protocol) natively, which means autocomplete, diagnostics, and refactoring like in VSCode&lt;/li&gt;
&lt;li&gt;Has a cleaner, more extensible architecture&lt;/li&gt;
&lt;li&gt;Updates faster with modern features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Does this mean Vim is dead? No. But for someone starting in 2026, &lt;strong&gt;Neovim is the recommended choice&lt;/strong&gt;. You can do the same with Vim, but with more manual work.&lt;/p&gt;

&lt;p&gt;So here we're going to install Neovim.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Neovim according to your operating system
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On Linux (Ubuntu/Debian and derivatives)
&lt;/h3&gt;

&lt;p&gt;If you use Ubuntu, Debian, Linux Mint, Pop!_OS, or any Debian-based distribution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;neovim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Easy, right? The problem is that official repositories sometimes have old versions. To make sure you have a recent version (we need at least 0.9.0), check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvim &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NVIM v0.10.0
Build type: Release
LuaJIT 2.1.0-beta3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your version is less than 0.9.0, I recommend installing from the official PPA or using the AppImage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Option 1: PPA (more up-to-date)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:neovim-ppa/unstable
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;neovim

&lt;span class="c"&gt;# Option 2: AppImage (portable, always updated)&lt;/span&gt;
curl &lt;span class="nt"&gt;-LO&lt;/span&gt; https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x nvim.appimage
&lt;span class="nb"&gt;sudo mv &lt;/span&gt;nvim.appimage /usr/local/bin/nvim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On Arch Linux and derivatives
&lt;/h3&gt;

&lt;p&gt;If you use Arch, Manjaro, EndeavourOS, etc., you're in luck. Neovim is always up-to-date in the official repos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; neovim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And done. Arch users don't need more explanation, you already know how this works.&lt;/p&gt;

&lt;h3&gt;
  
  
  On macOS
&lt;/h3&gt;

&lt;p&gt;If you use Mac, the easiest way is with &lt;strong&gt;Homebrew&lt;/strong&gt; (if you don't have it installed, go to &lt;a href="https://brew.sh" rel="noopener noreferrer"&gt;brew.sh&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;neovim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Homebrew takes care of giving you the latest stable version. Check that it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvim &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On Windows
&lt;/h3&gt;

&lt;p&gt;Here things get a bit complicated (because Windows, you know), but you have several options:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Scoop (recommended)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scoop is like Homebrew for Windows. If you don't have it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# In PowerShell as administrator&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;RemoteSigned&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;CurrentUser&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;irm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;get.scoop.sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# Install Neovim&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;neovim&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 2: Chocolatey&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you prefer Chocolatey:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;neovim&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 3: Manual download&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://github.com/neovim/neovim/releases" rel="noopener noreferrer"&gt;github.com/neovim/neovim/releases&lt;/a&gt;, download the &lt;code&gt;.msi&lt;/code&gt; installer, and run it.&lt;/p&gt;

&lt;p&gt;Once installed, open PowerShell or CMD and check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The first launch (and initial panic)
&lt;/h2&gt;

&lt;p&gt;Now that you have Neovim installed, open it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll find yourself with... an empty screen with the Neovim logo and some instructions. This is normal. Neovim without configuration is &lt;strong&gt;minimalist to the extreme&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Try typing something. You can't. Press &lt;code&gt;i&lt;/code&gt; (insert mode), type "Hello", press &lt;code&gt;Esc&lt;/code&gt;, type &lt;code&gt;:q!&lt;/code&gt; and press Enter to exit.&lt;/p&gt;

&lt;p&gt;Feeling confused? &lt;strong&gt;Perfect&lt;/strong&gt;. That means you're in the right place. Now we're going to give Neovim superpowers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is LazyVim and why do you need it?
&lt;/h2&gt;

&lt;p&gt;Configuring Neovim from scratch is like building a PC piece by piece. You can do it, and you'll learn a lot, but it takes &lt;strong&gt;weeks&lt;/strong&gt; to get something usable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LazyVim&lt;/strong&gt; is a preconfigured Neovim distribution that gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎨 A beautiful, modern theme (by default, TokyoNight)&lt;/li&gt;
&lt;li&gt;🔍 Telescope (fuzzy file finder, like Ctrl+P in VSCode)&lt;/li&gt;
&lt;li&gt;🌳 Neo-tree (sidebar file explorer)&lt;/li&gt;
&lt;li&gt;💡 Configured LSP (autocomplete, diagnostics, go to definition)&lt;/li&gt;
&lt;li&gt;🚀 Treesitter (advanced syntax highlighting)&lt;/li&gt;
&lt;li&gt;⚡ Lazy.nvim (ultra-fast plugin manager)&lt;/li&gt;
&lt;li&gt;🔧 Which-key (shows keyboard shortcuts as you use them)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this, &lt;strong&gt;working from minute zero&lt;/strong&gt;, without you having to configure anything.&lt;/p&gt;

&lt;p&gt;Think of it as the difference between buying a PC with components (pure Neovim) vs a Mac (LazyVim): the second works when you turn it on, the first requires assembly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing LazyVim dependencies
&lt;/h2&gt;

&lt;p&gt;LazyVim needs some tools installed on your system to work at 100%. Don't worry, they're quick to install.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Linux
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ripgrep fd-find

&lt;span class="c"&gt;# Arch&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; ripgrep fd

&lt;span class="c"&gt;# Optional but highly recommended: lazygit (for Git from Neovim)&lt;/span&gt;
&lt;span class="c"&gt;# Ubuntu/Debian (add the PPA)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:lazygit-team/release
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;lazygit

&lt;span class="c"&gt;# Arch&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; lazygit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On macOS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;ripgrep fd lazygit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On Windows (with Scoop)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ripgrep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;fd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;lazygit&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What do these tools do?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ripgrep&lt;/strong&gt; (&lt;code&gt;rg&lt;/code&gt;): Ultra-fast text search in files (like &lt;code&gt;grep&lt;/code&gt; but faster)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fd&lt;/strong&gt;: File search (like &lt;code&gt;find&lt;/code&gt; but more friendly)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lazygit&lt;/strong&gt;: TUI interface for Git (optional, but incredibly useful)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing a Nerd Font (critical for icons)
&lt;/h2&gt;

&lt;p&gt;LazyVim uses icons in the file explorer, status bar, etc. For them to display properly, you need a &lt;strong&gt;Nerd Font&lt;/strong&gt; (a font with integrated icons).&lt;/p&gt;

&lt;h3&gt;
  
  
  On Linux
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Download Fira Code Nerd Font&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.local/share/fonts
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.local/share/fonts
curl &lt;span class="nt"&gt;-fLo&lt;/span&gt; &lt;span class="s2"&gt;"Fira Code Nerd Font Complete.ttf"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Regular/FiraCodeNerdFont-Regular.ttf

&lt;span class="c"&gt;# Update font cache&lt;/span&gt;
fc-cache &lt;span class="nt"&gt;-fv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On macOS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap homebrew/cask-fonts
brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; font-fira-code-nerd-font
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On Windows
&lt;/h3&gt;

&lt;p&gt;Download the font from &lt;a href="https://www.nerdfonts.com/" rel="noopener noreferrer"&gt;nerdfonts.com&lt;/a&gt;, extract, right-click on the &lt;code&gt;.ttf&lt;/code&gt;, and "Install".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: Now you have to &lt;strong&gt;configure your terminal&lt;/strong&gt; to use this font. Go to your terminal settings (Windows Terminal, Alacritty, Kitty, iTerm2, etc.) and change the font to "FiraCode Nerd Font" or "FiraCode NF".&lt;/p&gt;

&lt;p&gt;If you don't do this, you'll see weird squares where icons should be.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing LazyVim (the moment of truth)
&lt;/h2&gt;

&lt;p&gt;Now yes. We're going to install LazyVim. But first, &lt;strong&gt;important&lt;/strong&gt;: if you already had a Neovim configuration, make a backup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Backup your current configuration (if it exists)&lt;/span&gt;
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.config/nvim ~/.config/nvim.backup
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.local/share/nvim ~/.local/share/nvim.backup
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.local/state/nvim ~/.local/state/nvim.backup
&lt;span class="nb"&gt;mv&lt;/span&gt; ~/.cache/nvim ~/.cache/nvim.backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows, the path is &lt;code&gt;~/AppData/Local/nvim&lt;/code&gt; instead of &lt;code&gt;~/.config/nvim&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, clone the LazyVim starter configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Linux/macOS&lt;/span&gt;
git clone https://github.com/LazyVim/starter ~/.config/nvim

&lt;span class="c"&gt;# Windows (PowerShell)&lt;/span&gt;
git clone https://github.com/LazyVim/starter &lt;span class="nv"&gt;$env&lt;/span&gt;:LOCALAPPDATA&lt;span class="se"&gt;\n&lt;/span&gt;vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the LazyVim configuration structure in your Neovim config folder.&lt;/p&gt;

&lt;p&gt;Now, remove the &lt;code&gt;.git&lt;/code&gt; directory so you can customize your configuration without conflicts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Linux/macOS&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.config/nvim/.git

&lt;span class="c"&gt;# Windows&lt;/span&gt;
Remove-Item &lt;span class="nt"&gt;-Recurse&lt;/span&gt; &lt;span class="nt"&gt;-Force&lt;/span&gt; &lt;span class="nv"&gt;$env&lt;/span&gt;:LOCALAPPDATA&lt;span class="se"&gt;\n&lt;/span&gt;vim&lt;span class="se"&gt;\.&lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The first LazyVim launch
&lt;/h2&gt;

&lt;p&gt;Take a deep breath. Open Neovim:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see... &lt;strong&gt;lots of things happening&lt;/strong&gt;. LazyVim is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installing the plugin manager (lazy.nvim)&lt;/li&gt;
&lt;li&gt;Downloading all configured plugins&lt;/li&gt;
&lt;li&gt;Compiling Treesitter parsers&lt;/li&gt;
&lt;li&gt;Installing LSP servers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This can take &lt;strong&gt;1-3 minutes&lt;/strong&gt; depending on your connection. You'll see a window with progress bars. &lt;strong&gt;Don't close Neovim&lt;/strong&gt;. Let it finish.&lt;/p&gt;

&lt;p&gt;When it's done, you'll see the LazyVim dashboard, something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;╭──────────────────────────────────────────╮
│                                          │
│           ⚡ LazyVim ⚡                   │
│                                          │
│   󰈞  Find File                           │
│   󰈢  Recent Files                        │
│   󰈬  Find Text                           │
│     Config                              │
│     Restore Session                     │
│   󰗼  Lazy                                │
│                                          │
╰──────────────────────────────────────────╯
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see this, &lt;strong&gt;congratulations!&lt;/strong&gt; LazyVim is working.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do I do now?
&lt;/h2&gt;

&lt;p&gt;Press &lt;code&gt;?&lt;/code&gt; to see keyboard shortcuts. Press &lt;code&gt;&amp;lt;Space&amp;gt;&lt;/code&gt; (spacebar) and wait a second: you'll see the &lt;strong&gt;Which-key&lt;/strong&gt; menu with all available commands.&lt;/p&gt;

&lt;p&gt;For now, &lt;strong&gt;don't stress&lt;/strong&gt; about learning all the shortcuts. In the next tutorial we're going to see the &lt;strong&gt;basic survival commands&lt;/strong&gt; to open files, edit them, save them, and exit without panic.&lt;/p&gt;

&lt;p&gt;But first, let's do a quick check that everything works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check: does LSP work?
&lt;/h2&gt;

&lt;p&gt;Let's create a test file to make sure autocomplete works.&lt;/p&gt;

&lt;p&gt;From Neovim, press &lt;code&gt;:&lt;/code&gt; (colon) and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;e&lt;/span&gt; test&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates (or opens) a file called &lt;code&gt;test.js&lt;/code&gt;. Now press &lt;code&gt;i&lt;/code&gt; (insert mode) and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you type &lt;code&gt;gree&lt;/code&gt;, an autocomplete menu should appear suggesting &lt;code&gt;greeting&lt;/code&gt;. If you see that, &lt;strong&gt;LSP works&lt;/strong&gt;. If not, don't worry, you may need to install the language server for JavaScript. LazyVim will ask you automatically the first time you open a &lt;code&gt;.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;Esc&lt;/code&gt;, then type &lt;code&gt;:q!&lt;/code&gt; and Enter to exit without saving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary: what we've achieved
&lt;/h2&gt;

&lt;p&gt;If you've made it this far, you now have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Neovim&lt;/strong&gt; installed and working (version 0.9.0+)&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;LazyVim&lt;/strong&gt; configured with modern plugins&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Nerd Font&lt;/strong&gt; installed for icons&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;CLI tools&lt;/strong&gt; (ripgrep, fd, lazygit) for full functionality&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;LSP&lt;/strong&gt; working (autocomplete, diagnostics)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What you &lt;strong&gt;DON'T&lt;/strong&gt; have yet is any idea how to use this. And that's normal. In the next tutorial we're going to learn the &lt;strong&gt;survival commands&lt;/strong&gt;: how to open files, move through text, edit, save, and (most importantly) &lt;strong&gt;how to exit Vim without Googling it&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final tips before continuing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Don't try to learn everything at once&lt;/strong&gt;. Vim literally has hundreds of commands. Start with the basics, use them until they become automatic, and then add more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't get frustrated if you're slow at first&lt;/strong&gt;. It's like learning to play piano: the first few days you're clumsy, but in a few weeks you'll be flying through code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't give up in the first few hours&lt;/strong&gt;. Vim's learning curve is steep at the beginning, but the reward is worth it.&lt;/p&gt;

&lt;p&gt;Now, breathe, close this tutorial, open Neovim, and get ready for the next step.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>vim</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Stashing Changes with git stash</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Wed, 17 Jun 2026 08:36:30 +0000</pubDate>
      <link>https://dev.to/fj_palacios/stashing-changes-with-git-stash-412k</link>
      <guid>https://dev.to/fj_palacios/stashing-changes-with-git-stash-412k</guid>
      <description>&lt;p&gt;Imagine this situation: you're working on a new feature, you've modified several files, but suddenly you get an urgent alert. There's a critical bug in production and you need to fix it &lt;strong&gt;right now&lt;/strong&gt;. The problem is that your current changes aren't ready for commit, they're half-done… What do you do?&lt;/p&gt;

&lt;p&gt;You could make a commit with a message like "WIP" (Work In Progress) and then undo it, but that pollutes your history. You could copy files to another folder, but that's manual and error-prone. Or… you could use &lt;code&gt;git stash&lt;/code&gt;, the perfect tool for this scenario.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is git stash?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git stash&lt;/code&gt; is like a temporary box where you can &lt;strong&gt;save&lt;/strong&gt; your current changes (both those in the &lt;em&gt;staging area&lt;/em&gt; and modified files) without needing to make a commit. Your working directory will be clean, as if you hadn't made any changes, and you'll be able to switch branches, do other tasks, and then &lt;strong&gt;recover&lt;/strong&gt; those changes exactly where you left them.&lt;/p&gt;

&lt;p&gt;Think of it as saving your game before turning off the console. You don't lose your progress, you just pause it to resume later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saving changes with git stash
&lt;/h2&gt;

&lt;p&gt;Let's see it with a practical example. Suppose you're working on your project and you've modified &lt;code&gt;index.html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to my awesome site&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a work in progress feature...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you run &lt;code&gt;git status&lt;/code&gt; you'll see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;On branch feature/new-homepage
Changes not staged &lt;span class="k"&gt;for &lt;/span&gt;commit:
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add &amp;lt;file&amp;gt;..."&lt;/span&gt; to update what will be committed&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git restore &amp;lt;file&amp;gt;..."&lt;/span&gt; to discard changes &lt;span class="k"&gt;in &lt;/span&gt;working directory&lt;span class="o"&gt;)&lt;/span&gt;
        modified:   index.html

no changes added to commit &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add"&lt;/span&gt; and/or &lt;span class="s2"&gt;"git commit -a"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the urgency arrives. You need to switch to &lt;code&gt;master&lt;/code&gt; to fix that bug. If you try to switch branches like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git will prevent you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;error: Your &lt;span class="nb"&gt;local &lt;/span&gt;changes to the following files would be overwritten by checkout:
        index.html
Please commit your changes or stash them before you switch branches.
Aborting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git is protecting you! It doesn't want you to lose your changes. This is where &lt;code&gt;git stash&lt;/code&gt; comes in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if you want to be more explicit and add a descriptive message (highly recommended when you have multiple stashes):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash push &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"WIP: New homepage"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Saved working directory and index state On feature/new-homepage: WIP: New homepage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now? Check with &lt;code&gt;git status&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;On branch feature/new-homepage
nothing to commit, working tree clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Magic! Your directory is clean. Now you can safely switch to &lt;code&gt;master&lt;/code&gt;, fix the bug, commit, and return to your working branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Listing your stashes
&lt;/h2&gt;

&lt;p&gt;What happens if you save several changes at different times? Git maintains a &lt;strong&gt;list&lt;/strong&gt; of all your stashes. To see it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll get something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stash@&lt;span class="o"&gt;{&lt;/span&gt;0&lt;span class="o"&gt;}&lt;/span&gt;: On feature/new-homepage: WIP: New homepage
stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;: On feature/api-integration: Partial API changes
stash@&lt;span class="o"&gt;{&lt;/span&gt;2&lt;span class="o"&gt;}&lt;/span&gt;: On master: CSS experiment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each stash has an identifier: &lt;code&gt;stash@{0}&lt;/code&gt;, &lt;code&gt;stash@{1}&lt;/code&gt;, etc. The most recent is always &lt;code&gt;{0}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing stash contents
&lt;/h2&gt;

&lt;p&gt;Before recovering a stash, you might want to remember what changes you saved. For that you use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows you a summary of the most recent stash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; index.html | 1 +
 1 file changed, 1 insertion&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to see the full content (like a diff):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash show &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/index.html b/index.html
index 1234567..abcdefg 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/index.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/index.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1 +1,2 @@&lt;/span&gt;
 &amp;lt;h1&amp;gt;Welcome to my awesome site&amp;lt;/h1&amp;gt;
&lt;span class="gi"&gt;+&amp;lt;p&amp;gt;This is a work in progress feature...&amp;lt;/p&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see a specific stash (not the most recent):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash show stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Recovering your changes: apply vs pop
&lt;/h2&gt;

&lt;p&gt;Now that you've fixed the urgent bug and returned to your &lt;code&gt;feature/new-homepage&lt;/code&gt; branch, you want to recover your changes. You have two options:&lt;/p&gt;

&lt;h3&gt;
  
  
  git stash pop
&lt;/h3&gt;

&lt;p&gt;This command &lt;strong&gt;recovers&lt;/strong&gt; the most recent stash and &lt;strong&gt;removes&lt;/strong&gt; it from the list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;On branch feature/new-homepage
Changes not staged &lt;span class="k"&gt;for &lt;/span&gt;commit:
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add &amp;lt;file&amp;gt;..."&lt;/span&gt; to update what will be committed&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git restore &amp;lt;file&amp;gt;..."&lt;/span&gt; to discard changes &lt;span class="k"&gt;in &lt;/span&gt;working directory&lt;span class="o"&gt;)&lt;/span&gt;
        modified:   index.html

Dropped refs/stash@&lt;span class="o"&gt;{&lt;/span&gt;0&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;abc1234...&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your changes are back and the stash has been deleted. It's like taking something out of the box and throwing the box away.&lt;/p&gt;

&lt;h3&gt;
  
  
  git stash apply
&lt;/h3&gt;

&lt;p&gt;This command &lt;strong&gt;recovers&lt;/strong&gt; the stash but does &lt;strong&gt;NOT remove&lt;/strong&gt; it from the list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful if you want to apply the same changes to several different branches, or if you're not sure you want to delete the stash yet.&lt;/p&gt;

&lt;p&gt;To apply a specific stash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash apply stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if after applying it you want to manually delete it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash drop stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced situation: conflicts with stash
&lt;/h2&gt;

&lt;p&gt;What happens if while your changes were saved in the stash, you modified the same files with other commits? When trying to do &lt;code&gt;git stash pop&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt;, Git may encounter &lt;strong&gt;conflicts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, if you saved changes to &lt;code&gt;index.html&lt;/code&gt;, then made a commit modifying that same file, and now try to recover the stash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Auto-merging index.html
CONFLICT &lt;span class="o"&gt;(&lt;/span&gt;content&lt;span class="o"&gt;)&lt;/span&gt;: Merge conflict &lt;span class="k"&gt;in &lt;/span&gt;index.html
The stash entry is kept &lt;span class="k"&gt;in case&lt;/span&gt; you need it again.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git warns you of the conflict, and &lt;strong&gt;keeps the stash&lt;/strong&gt; for safety (even though you used &lt;code&gt;pop&lt;/code&gt;). You'll have to resolve the conflict manually as you would with any merge, editing the file, doing &lt;code&gt;git add&lt;/code&gt;, and then deleting the stash with &lt;code&gt;git stash drop&lt;/code&gt; if you no longer need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a branch from a stash
&lt;/h2&gt;

&lt;p&gt;Sometimes you recover a stash and it turns out the conflicts are too complex. Git offers an elegant solution: create a &lt;strong&gt;new branch&lt;/strong&gt; directly from the stash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash branch new-temp-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creates a new branch called &lt;code&gt;new-temp-branch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Checks out that branch&lt;/li&gt;
&lt;li&gt;Applies the stash to it&lt;/li&gt;
&lt;li&gt;Removes the stash from the list&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's perfect for isolating problematic changes and working on them without affecting other branches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleaning old stashes
&lt;/h2&gt;

&lt;p&gt;Over time you may accumulate stashes you no longer need. To delete a specific stash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash drop stash@&lt;span class="o"&gt;{&lt;/span&gt;2&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete &lt;strong&gt;all&lt;/strong&gt; stashes (be careful with this!):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical use cases
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Urgent context switching
&lt;/h3&gt;

&lt;p&gt;We already saw this: you're working, an urgency arrives, you do &lt;code&gt;git stash&lt;/code&gt;, switch branches, fix it, return, and &lt;code&gt;git stash pop&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Testing something quickly
&lt;/h3&gt;

&lt;p&gt;You have local changes but want to test how the code works without them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
&lt;span class="c"&gt;# Testing...&lt;/span&gt;
git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Clean working directory to pull
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to do &lt;code&gt;git pull&lt;/code&gt; but have local changes that conflict:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
git pull
git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Save experimental changes
&lt;/h3&gt;

&lt;p&gt;You're experimenting with something you're not sure you want to commit. Stash it, work on something else, and decide later if you want to recover that experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful git stash options
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git stash -u&lt;/code&gt; or &lt;code&gt;git stash --include-untracked&lt;/code&gt;: Includes &lt;strong&gt;untracked files&lt;/strong&gt; in the stash. By default, &lt;code&gt;git stash&lt;/code&gt; only saves files that Git is already tracking.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git stash -a&lt;/code&gt; or &lt;code&gt;git stash --all&lt;/code&gt;: Includes &lt;strong&gt;all&lt;/strong&gt; files, even those in &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git stash push &amp;lt;file&amp;gt;&lt;/code&gt;: Saves only specific files:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  git stash push index.html styles.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git stash push -p&lt;/code&gt;: Interactive mode, asks you &lt;strong&gt;hunk by hunk&lt;/strong&gt; what you want to save in the stash.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git stash&lt;/code&gt; is an &lt;strong&gt;essential&lt;/strong&gt; tool for daily Git workflow. It allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Temporarily save&lt;/strong&gt; changes without committing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch context&lt;/strong&gt; quickly between tasks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Experiment&lt;/strong&gt; without fear of losing your work&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolve conflicts&lt;/strong&gt; in an organized way with &lt;code&gt;git stash branch&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key commands are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git stash&lt;/code&gt; or &lt;code&gt;git stash push -m "message"&lt;/code&gt;: Save changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash list&lt;/code&gt;: View saved stashes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash show -p&lt;/code&gt;: View stash contents&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash pop&lt;/code&gt;: Recover and delete the last stash&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash apply&lt;/code&gt;: Recover without deleting&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash drop&lt;/code&gt;: Delete a specific stash&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash clear&lt;/code&gt;: Delete all stashes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mastering &lt;code&gt;git stash&lt;/code&gt; will make you much more agile and confident in your daily work. It's one of those tools that, once you know it, you wonder how you lived without it.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Vim? The Modal Editing Philosophy</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Tue, 16 Jun 2026 08:40:44 +0000</pubDate>
      <link>https://dev.to/fj_palacios/why-vim-the-modal-editing-philosophy-18lj</link>
      <guid>https://dev.to/fj_palacios/why-vim-the-modal-editing-philosophy-18lj</guid>
      <description>&lt;p&gt;If you're reading this, you're probably curious about Vim. Maybe you've seen a coworker editing code at lightning speed without touching the mouse. Maybe you've heard the meme about "how to exit Vim". Or maybe you simply want to understand &lt;strong&gt;why so many people still use a text editor from the 90s in 2026&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Welcome. This is the beginning of a journey that will forever change the way you edit text.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Vim? And Neovim?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vim&lt;/strong&gt; is a modal, highly configurable, and extremely efficient text editor. It was created by Bram Moolenaar in 1991 as an improvement to &lt;strong&gt;vi&lt;/strong&gt; (1976), the standard Unix editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Neovim&lt;/strong&gt; is a modern fork of Vim (2014) that preserves all the original philosophy but adds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Native support for &lt;strong&gt;LSP&lt;/strong&gt; (Language Server Protocol) - autocompletion, diagnostics, refactoring&lt;/li&gt;
&lt;li&gt;Modern architecture with &lt;strong&gt;asynchronous APIs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Configuration in &lt;strong&gt;Lua&lt;/strong&gt; (in addition to Vimscript)&lt;/li&gt;
&lt;li&gt;Better performance and code maintainability&lt;/li&gt;
&lt;li&gt;Active community and modern plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this course we'll use &lt;strong&gt;Neovim&lt;/strong&gt; because it's the future of Vim. Everything you learn works in classic Vim, but Neovim gives you additional superpowers.&lt;/p&gt;

&lt;h3&gt;
  
  
  A bit of history: vi → Vim → Neovim
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1976: vi (Bill Joy)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The original Unix editor. Designed for slow terminals connected via phone lines. Modal editing wasn't a whim: it was &lt;strong&gt;technical necessity&lt;/strong&gt;. You couldn't send every keystroke to the server in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1991: Vim (Bram Moolenaar)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
"Vi IMproved". Added windows, syntax highlighting, plugins, and a thousand improvements while maintaining the modal essence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2014: Neovim (Community)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Fork of Vim to modernize it. Asynchronous architecture, native LSP, Lua, better extensibility. Vim and Neovim coexist: many use Neovim but both are valid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2026: LazyVim and modern distributions&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Pre-packaged configurations that turn Neovim into a complete IDE in minutes. This is what we'll use in this course.&lt;/p&gt;
&lt;h2&gt;
  
  
  The modal editing paradigm
&lt;/h2&gt;

&lt;p&gt;This is &lt;strong&gt;the idea that will change your life as a programmer&lt;/strong&gt;: instead of having a single mode where you type and navigate mixed together (like VS Code or Sublime), Vim radically separates these two concepts.&lt;/p&gt;
&lt;h3&gt;
  
  
  The four modes of Vim
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Normal Mode&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The default mode. &lt;strong&gt;You don't type text, you navigate and execute commands&lt;/strong&gt;. You'll spend 80% of your time here. You can move word by word, delete lines, copy blocks, search, replace... without touching the mouse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert Mode&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This is where you DO type text, like in any normal editor. But the key is: &lt;strong&gt;you enter, make ONE edit, and exit&lt;/strong&gt;. Vim trains you to make atomic, precise changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visual Mode&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
To visually select text (like dragging with the mouse, but with the keyboard). You can select characters, complete lines, or rectangular blocks (yes, vertical blocks of code).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command Mode&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Execute Vim commands by typing &lt;code&gt;:something&lt;/code&gt;. Here you save files (&lt;code&gt;:w&lt;/code&gt;), exit (&lt;code&gt;:q&lt;/code&gt;), search and replace (&lt;code&gt;:s/old/new/g&lt;/code&gt;), open files, etc.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why is this so powerful?
&lt;/h3&gt;

&lt;p&gt;In traditional editors, to delete a word you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Double-click to select the word (mouse)&lt;/li&gt;
&lt;li&gt;Or &lt;code&gt;Ctrl+Shift+→&lt;/code&gt; (three keys at once)&lt;/li&gt;
&lt;li&gt;Backspace or Delete&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In Vim:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;dw&lt;/code&gt; (two keys in normal mode)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Delete to the end of the line?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt;: &lt;code&gt;Shift+End&lt;/code&gt; → &lt;code&gt;Backspace&lt;/code&gt; (3 keys + move hand to mouse if you mess up)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vim&lt;/strong&gt;: &lt;code&gt;D&lt;/code&gt; (one key)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Delete everything inside quotes?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt;: Double-click, adjust selection, Delete (several movements)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vim&lt;/strong&gt;: &lt;code&gt;di"&lt;/code&gt; (three keys: delete inside quotes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The magic isn't in individual shortcuts. &lt;strong&gt;The magic is in the composable language&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Vim language: composable grammar
&lt;/h2&gt;

&lt;p&gt;Vim doesn't have "keyboard shortcuts". &lt;strong&gt;Vim has a language&lt;/strong&gt;. And once you learn the grammar, you can combine concepts infinitely.&lt;/p&gt;

&lt;p&gt;The basic structure is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[count] operator motion
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Operators:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;d&lt;/code&gt; - delete&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;c&lt;/code&gt; - change (delete and enter insert mode)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;y&lt;/code&gt; - yank (copy)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;v&lt;/code&gt; - visual select&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Motions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; - word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; - end of line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i"&lt;/code&gt; - inside quotes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ap&lt;/code&gt; - a paragraph&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;t.&lt;/code&gt; - till .&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Combined examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dw&lt;/code&gt; - delete word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;d$&lt;/code&gt; - delete to end of line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;di"&lt;/code&gt; - delete inside quotes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cap&lt;/code&gt; - change a paragraph&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;y3w&lt;/code&gt; - yank 3 words&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dt.&lt;/code&gt; - delete till .&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See the pattern? &lt;strong&gt;You don't memorize shortcuts, you learn vocabulary&lt;/strong&gt;. Once you know that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;i(&lt;/code&gt; means "inside parentheses"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a{&lt;/code&gt; means "around braces"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;c&lt;/code&gt; means "change"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then &lt;code&gt;ci(&lt;/code&gt; (change inside parentheses) is obvious. And &lt;code&gt;da{&lt;/code&gt; (delete around braces) too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This scales. Regular keyboard shortcuts don't.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Common myths about Vim
&lt;/h2&gt;

&lt;p&gt;Before continuing, let's debunk some misconceptions:&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ "Vim is too hard"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reality&lt;/strong&gt;: Vim has a steep learning curve at the beginning (2-3 uncomfortable days), but then it becomes exponentially easier. Most editors have a flat curve: you're always equally "slow".&lt;/p&gt;

&lt;p&gt;Vim is like learning to play guitar: the first chords are tough, but once you master them, you can play thousands of songs. Traditional shortcuts are like memorizing each song note by note.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ "Vim is only for terminals / 'old-school' people"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reality&lt;/strong&gt;: Neovim in 2026 with LazyVim has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LSP (autocompletion, go-to-definition, refactoring)&lt;/li&gt;
&lt;li&gt;Tree-sitter (advanced syntax highlighting)&lt;/li&gt;
&lt;li&gt;Telescope (fuzzy finder like VS Code's Cmd+P)&lt;/li&gt;
&lt;li&gt;Neo-tree (visual file explorer)&lt;/li&gt;
&lt;li&gt;Git integration (like GitLens)&lt;/li&gt;
&lt;li&gt;Integrated debugger (DAP)&lt;/li&gt;
&lt;li&gt;Support for any language (TypeScript, Rust, Python, Go...)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;It's a complete IDE, not a plain text editor.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ "I don't need Vim, VS Code is enough"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reality&lt;/strong&gt;: This is the most common trap. VS Code is excellent, but:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt;: Editing with Vim is 2-3x faster once you master it. No exaggeration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ergonomics&lt;/strong&gt;: You don't need a mouse. Your hands never leave the home row. Goodbye wrist pain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability&lt;/strong&gt;: Vim is on any remote server. SSH to a server and you can edit with the same skills.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: Neovim uses 50MB of RAM. VS Code uses 500MB+ (and that's just on startup).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Plus, there's a &lt;strong&gt;VSCode Neovim extension&lt;/strong&gt; if you want the best of both worlds.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ "Vim is for purists who hate modern technology"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reality&lt;/strong&gt;: GitHub, Google, Meta, Netflix have thousands of engineers using Vim/Neovim in 2026. &lt;strong&gt;ThePrimeagen&lt;/strong&gt; (Netflix engineer) has millions of YouTube views teaching Neovim. This isn't nostalgia, it's &lt;strong&gt;pragmatism&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why learn Vim in 2026?
&lt;/h2&gt;

&lt;p&gt;Let me give you &lt;strong&gt;pragmatic reasons&lt;/strong&gt;, not nostalgic ones:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Editing speed (productivity multiplier)
&lt;/h3&gt;

&lt;p&gt;Once you master Vim, editing code is like &lt;strong&gt;thinking at the speed of your fingers&lt;/strong&gt;. There's no friction between "I want to change this" and "I've changed it".&lt;/p&gt;

&lt;p&gt;Real example: refactoring 20 function calls in a file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt;: Search, Cmd+D for each match, edit (2 minutes, carefully)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vim&lt;/strong&gt;: &lt;code&gt;:%s/oldFunc/newFunc/gc&lt;/code&gt; (10 seconds, with visual confirmation)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Ergonomics and health
&lt;/h3&gt;

&lt;p&gt;As a programmer, you'll spend &lt;strong&gt;30,000+ hours&lt;/strong&gt; of your life editing code. Do you want to spend them moving your hand to the mouse 500 times a day?&lt;/p&gt;

&lt;p&gt;Vim keeps you on the &lt;strong&gt;home row&lt;/strong&gt; (asdfghjkl). Less movement = less fatigue = less risk of repetitive strain injuries.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Works in ANY environment
&lt;/h3&gt;

&lt;p&gt;SSH to a production server without a graphical interface. Does your VS Code work there? No.&lt;/p&gt;

&lt;p&gt;Vim is &lt;strong&gt;everywhere&lt;/strong&gt;: Linux servers, Docker containers, Raspberry Pi, your Mac, your Windows PC... Learn once, use everywhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Composability with the terminal
&lt;/h3&gt;

&lt;p&gt;Vim isn't just an editor. It's part of &lt;strong&gt;the Unix philosophy&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# View only lines with "error" from a file&lt;/span&gt;
vim +&lt;span class="s1"&gt;'g/error/p'&lt;/span&gt; file.log

&lt;span class="c"&gt;# Sort lines alphabetically from Vim&lt;/span&gt;
:%!sort

&lt;span class="c"&gt;# Format JSON&lt;/span&gt;
:%!jq &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vim integrates with &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, &lt;code&gt;awk&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;tmux&lt;/code&gt;... It's part of an ecosystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Once you learn it, it's for life
&lt;/h3&gt;

&lt;p&gt;VS Code shortcuts change with each version. Plugins break. Configuration becomes obsolete.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vim is 30 years old and the commands are still the same.&lt;/strong&gt; What you learn now will work in 2030, 2040, 2050... Learn Vim once, use it forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world use cases
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Web development (React, Vue, Svelte)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
LSP for TypeScript, autocompletion, linting with ESLint, formatting with Prettier, Git integration, Node.js debugger. All from Neovim.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backend (Python, Go, Rust)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
LSP for each language, testing with pytest/go test, DAP for debugging, integration with Docker/Kubernetes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Science&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Jupyter notebooks inside Neovim (Jupytext), Pandas, NumPy with autocompletion, graph visualization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevOps / SRE&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Edit files on remote servers, Bash scripts, YAML/JSON configurations, IaC with Terraform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical writing&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Markdown with preview, spell checking, grammar, Pandoc integration to generate PDFs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vim vs modern editors (2026)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Vim/Neovim&lt;/th&gt;
&lt;th&gt;VS Code&lt;/th&gt;
&lt;th&gt;IntelliJ&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Editing speed&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAM consumption&lt;/td&gt;
&lt;td&gt;50MB&lt;/td&gt;
&lt;td&gt;500MB+&lt;/td&gt;
&lt;td&gt;1GB+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LSP / Autocompletion&lt;/td&gt;
&lt;td&gt;✅ Native&lt;/td&gt;
&lt;td&gt;✅ Native&lt;/td&gt;
&lt;td&gt;✅ Native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customization&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning curve&lt;/td&gt;
&lt;td&gt;Steep&lt;/td&gt;
&lt;td&gt;Gentle&lt;/td&gt;
&lt;td&gt;Gentle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote environments (SSH)&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡ (limited)&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ergonomics (no mouse)&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡ (with extensions)&lt;/td&gt;
&lt;td&gt;⚡&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plugin ecosystem&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free and open source&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌ (Community yes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Config stability&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡&lt;/td&gt;
&lt;td&gt;⚡⚡⚡⚡&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Verdict&lt;/strong&gt;: Vim isn't "better" at everything, but &lt;strong&gt;for pure text and code editing, it has no rival&lt;/strong&gt;. For giant projects with many integrated tools, IntelliJ shines. VS Code is the accessible middle ground.&lt;/p&gt;

&lt;p&gt;Many professionals use &lt;strong&gt;Neovim for quick editing + IntelliJ/VS Code for complex debugging&lt;/strong&gt;. Or simply &lt;strong&gt;Neovim + extensions&lt;/strong&gt; for everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is Vim for you?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vim is for you if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ You spend 4+ hours a day editing code&lt;/li&gt;
&lt;li&gt;✅ You want to be more efficient long-term (even if it hurts at first)&lt;/li&gt;
&lt;li&gt;✅ You like optimizing your tools&lt;/li&gt;
&lt;li&gt;✅ You work with remote servers or Docker&lt;/li&gt;
&lt;li&gt;✅ You want a tool that lasts decades&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Vim is NOT for you if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ You only code occasionally (1-2 hours a week)&lt;/li&gt;
&lt;li&gt;❌ You don't have patience for 1-2 weeks of initial discomfort&lt;/li&gt;
&lt;li&gt;❌ You only work on visual projects (UI/UX design, not code)&lt;/li&gt;
&lt;li&gt;❌ You need immediate results without time investment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;In the next lesson we'll install &lt;strong&gt;Neovim + LazyVim&lt;/strong&gt; on your system. LazyVim is a pre-made configuration that gives you a modern IDE in 5 minutes, without needing to configure anything manually.&lt;/p&gt;

&lt;p&gt;Then we'll learn to &lt;strong&gt;survive in Vim&lt;/strong&gt;: how to open files, move around, edit, save, and exit (yes, the famous &lt;code&gt;:q&lt;/code&gt; that became a meme).&lt;/p&gt;

&lt;p&gt;In just 3-4 lessons you'll already be editing real code. And in 2 weeks, you'll be faster than with your current editor. I promise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key concepts from this lesson
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vim&lt;/strong&gt; is a modal editor (1991), &lt;strong&gt;Neovim&lt;/strong&gt; is its modern fork (2014)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modal editing&lt;/strong&gt; separates navigation (Normal) from typing (Insert) from selection (Visual)&lt;/li&gt;
&lt;li&gt;Vim has a &lt;strong&gt;composable language&lt;/strong&gt;: operators + motions = infinite combinations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They're not shortcuts, it's grammar&lt;/strong&gt;: &lt;code&gt;di"&lt;/code&gt; (delete inside quotes) is obvious if you know the syntax&lt;/li&gt;
&lt;li&gt;Vim is NOT "old-school": with &lt;strong&gt;LazyVim&lt;/strong&gt; you have LSP, fuzzy finder, debugger, Git integration... a complete IDE&lt;/li&gt;
&lt;li&gt;The learning curve is real, but &lt;strong&gt;the investment is worth it&lt;/strong&gt; if you spend hours editing code&lt;/li&gt;
&lt;li&gt;Vim is &lt;strong&gt;portable&lt;/strong&gt; (works on servers), &lt;strong&gt;efficient&lt;/strong&gt; (50MB RAM), &lt;strong&gt;ergonomic&lt;/strong&gt; (no mouse needed)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Ready to install Neovim and enter the Matrix? See you in the next lesson.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>vim</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Advanced branching in Git</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Mon, 15 Jun 2026 10:32:47 +0000</pubDate>
      <link>https://dev.to/fj_palacios/advanced-branching-in-git-32ei</link>
      <guid>https://dev.to/fj_palacios/advanced-branching-in-git-32ei</guid>
      <description>&lt;p&gt;You've already seen in previous tutorials how to create branches, switch between them, and do basic merges. Now it's time to go deeper: we'll look at the different merge strategies Git has, how to manage branches efficiently, and some special situations you'll encounter sooner or later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fast-forward vs non-fast-forward merges
&lt;/h2&gt;

&lt;p&gt;When you merge one branch into another, Git has to decide &lt;em&gt;how&lt;/em&gt; to do it. The simplest way is the &lt;strong&gt;fast-forward&lt;/strong&gt; merge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast-forward merge
&lt;/h3&gt;

&lt;p&gt;Imagine you create a &lt;code&gt;feature&lt;/code&gt; branch from &lt;code&gt;master&lt;/code&gt;, make some commits on &lt;code&gt;feature&lt;/code&gt;, but &lt;code&gt;master&lt;/code&gt; hasn't moved since then. When you go back to &lt;code&gt;master&lt;/code&gt; and merge &lt;code&gt;feature&lt;/code&gt;, Git simply moves the &lt;code&gt;master&lt;/code&gt; pointer to the last commit of &lt;code&gt;feature&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout master
git merge feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;Updating f7c5eba..e02c63c
Fast-forward
&lt;/span&gt; index.html | 2 ++
 1 file changed, 2 insertions(+)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Fast-forward&lt;/strong&gt; message tells you that no merge commit was created: the pointer was just moved. The history remains linear, as if you'd never used branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Non-fast-forward merge (merge commit)
&lt;/h3&gt;

&lt;p&gt;But if &lt;code&gt;master&lt;/code&gt; has moved forward while you worked on &lt;code&gt;feature&lt;/code&gt;, Git can't do a fast-forward. It has to create a &lt;strong&gt;merge commit&lt;/strong&gt; that joins both lines of development:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;Merge made by the 'recursive' strategy.
&lt;/span&gt; about.html | 10 ++++++++++
 1 file changed, 10 insertions(+)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This merge commit has &lt;em&gt;two parents&lt;/em&gt;: the last commit of &lt;code&gt;master&lt;/code&gt; and the last of &lt;code&gt;feature&lt;/code&gt;. The history is no longer linear.&lt;/p&gt;

&lt;h3&gt;
  
  
  Force a merge commit (--no-ff)
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to create a merge commit even though Git could do a fast-forward. This is useful for keeping an explicit record that there was a branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &lt;span class="nt"&gt;--no-ff&lt;/span&gt; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it clear in the history that &lt;code&gt;feature&lt;/code&gt; was a separate branch, even if &lt;code&gt;master&lt;/code&gt; hadn't moved forward. It's common in workflows where you want to document each feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Force fast-forward (--ff-only)
&lt;/h3&gt;

&lt;p&gt;Conversely, you can make Git only merge if a fast-forward is possible. If it's not, the command fails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &lt;span class="nt"&gt;--ff-only&lt;/span&gt; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;master&lt;/code&gt; has moved forward, you'll see an error. This forces you to rebase before merging, keeping the history linear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Merge strategies
&lt;/h2&gt;

&lt;p&gt;Git has several strategies for merging branches. Most of the time you don't have to worry about this (Git chooses the best one), but it's good to know they exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  recursive (default)
&lt;/h3&gt;

&lt;p&gt;This is the strategy Git uses in most cases. It can handle complex scenarios where there are many changes in both branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  ours and theirs
&lt;/h3&gt;

&lt;p&gt;When there are conflicts, you can tell Git to always prefer one version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Always prefer changes from the current branch&lt;/span&gt;
git merge &lt;span class="nt"&gt;-X&lt;/span&gt; ours feature

&lt;span class="c"&gt;# Always prefer changes from the branch you're merging&lt;/span&gt;
git merge &lt;span class="nt"&gt;-X&lt;/span&gt; theirs feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when you know beforehand which version you want to keep in case of conflict.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch management with git branch
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;git branch&lt;/code&gt; command isn't just for creating branches. It has many options for managing them.&lt;/p&gt;

&lt;h3&gt;
  
  
  List branches
&lt;/h3&gt;

&lt;p&gt;Without arguments, it lists all local branches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  feature
* master
  bugfix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The asterisk (&lt;code&gt;*&lt;/code&gt;) indicates which branch you're currently on.&lt;/p&gt;

&lt;p&gt;To also see remote branches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  feature
* master
  bugfix
  remotes/origin/master
  remotes/origin/develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rename a branch
&lt;/h3&gt;

&lt;p&gt;If you make a mistake with a branch name (or decide to change it), use &lt;code&gt;-m&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-m&lt;/span&gt; old-name new-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're on the branch you want to rename, just use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-m&lt;/span&gt; new-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete a branch
&lt;/h3&gt;

&lt;p&gt;Once you've merged a branch, you probably don't need it anymore. To delete it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git will warn you if the branch hasn't been merged yet. If you're sure you want to delete it anyway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-D&lt;/span&gt; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The capital &lt;code&gt;-D&lt;/code&gt; forces deletion even if there's unmerged work.&lt;/p&gt;

&lt;h3&gt;
  
  
  See merged branches
&lt;/h3&gt;

&lt;p&gt;To know which branches have already been merged into the current branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;--merged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And to see those that haven't been merged yet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;--no-merged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful for cleaning up old branches.&lt;/p&gt;

&lt;h2&gt;
  
  
  git switch: the modern alternative to checkout
&lt;/h2&gt;

&lt;p&gt;Since Git 2.23 (2019) there's &lt;code&gt;git switch&lt;/code&gt;, a command designed specifically for switching branches. Previously &lt;code&gt;git checkout&lt;/code&gt; was used for everything, but that was confusing because &lt;code&gt;checkout&lt;/code&gt; does too many different things.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switch branches
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch master
git switch feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's clearer than &lt;code&gt;git checkout&lt;/code&gt; because &lt;code&gt;switch&lt;/code&gt; is only for changing branches, nothing else.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create and switch to a new branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Equivalent to the old &lt;code&gt;git checkout -b new-branch&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Go back to the previous branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dash (&lt;code&gt;-&lt;/code&gt;) takes you to the branch you were on before. Very useful for going back and forth between two branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I use switch or checkout?
&lt;/h3&gt;

&lt;p&gt;If your Git version is 2.23 or higher (which it should be), &lt;strong&gt;use &lt;code&gt;git switch&lt;/code&gt; to change branches&lt;/strong&gt;. Reserve &lt;code&gt;git checkout&lt;/code&gt; for recovering files (or even better, use &lt;code&gt;git restore&lt;/code&gt; for that).&lt;/p&gt;

&lt;p&gt;It's more semantic and avoids confusion. Old tutorials will continue using &lt;code&gt;checkout&lt;/code&gt;, but &lt;code&gt;switch&lt;/code&gt; is the way forward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detached HEAD: what it is and how to get out
&lt;/h2&gt;

&lt;p&gt;Every now and then Git will tell you you're in a &lt;strong&gt;detached HEAD&lt;/strong&gt; state. It sounds alarming, but don't worry: it's a perfectly valid situation (though a bit special).&lt;/p&gt;

&lt;h3&gt;
  
  
  What is detached HEAD?
&lt;/h3&gt;

&lt;p&gt;Normally, &lt;code&gt;HEAD&lt;/code&gt; points to a branch (for example, &lt;code&gt;master&lt;/code&gt;), and that branch points to a commit. When you make a new commit, the branch automatically advances.&lt;/p&gt;

&lt;p&gt;But if you &lt;code&gt;checkout&lt;/code&gt; a specific commit instead of a branch, &lt;code&gt;HEAD&lt;/code&gt; points directly to the commit, not to any branch. That's &lt;em&gt;detached HEAD&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout e02c63c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Note: switching to 'e02c63c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  When does it happen?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When you &lt;code&gt;checkout&lt;/code&gt; a specific commit (not a branch)&lt;/li&gt;
&lt;li&gt;When you &lt;code&gt;checkout&lt;/code&gt; a tag&lt;/li&gt;
&lt;li&gt;When you rebase interactively and Git temporarily places you on old commits&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Is it dangerous?
&lt;/h3&gt;

&lt;p&gt;No, but be careful: if you make commits in this state and then switch branches without saving those commits to a branch, they'll be orphaned and eventually Git will delete them (though with &lt;code&gt;reflog&lt;/code&gt; you can recover them).&lt;/p&gt;

&lt;h3&gt;
  
  
  How to get out
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Option 1: Simply go back to a branch
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any commits you made in detached HEAD will be lost (unless you save them with reflog).&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 2: Create a branch from there
&lt;/h4&gt;

&lt;p&gt;If you made changes you want to keep:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; new-experiment-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now those commits are on &lt;code&gt;new-experiment-branch&lt;/code&gt; and you can merge it wherever you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical cases
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Maintaining a linear history
&lt;/h3&gt;

&lt;p&gt;If you prefer a history without merge commits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Before merging &lt;code&gt;feature&lt;/code&gt; into &lt;code&gt;master&lt;/code&gt;, rebase:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git checkout feature
   git rebase master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then merge with fast-forward:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git checkout master
   git merge &lt;span class="nt"&gt;--ff-only&lt;/span&gt; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps the history completely linear.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cleaning up old branches
&lt;/h3&gt;

&lt;p&gt;To delete all branches that have already been merged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;--merged&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | xargs git branch &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lists merged branches, excludes the current one (&lt;code&gt;grep -v "\*"&lt;/code&gt;), and deletes them all.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recovering an accidentally deleted branch
&lt;/h3&gt;

&lt;p&gt;If you deleted a branch and then regretted it, you can recover it with &lt;code&gt;reflog&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the commit where the branch was before deletion, and create a new branch there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch recovered-branch &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;With what you've learned in this tutorial you now have advanced mastery of branches in Git. You know how to merge in different ways, manage branches efficiently with &lt;code&gt;git branch&lt;/code&gt; and &lt;code&gt;git switch&lt;/code&gt;, and even how to get out of a detached HEAD without losing work.&lt;/p&gt;

&lt;p&gt;In the next tutorial we'll look at &lt;code&gt;git stash&lt;/code&gt;, an essential tool for when you need to quickly change context without committing half-finished changes.&lt;/p&gt;

&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Variables and data types in Python</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Sun, 14 Jun 2026 18:07:26 +0000</pubDate>
      <link>https://dev.to/fj_palacios/variables-and-data-types-in-python-18jl</link>
      <guid>https://dev.to/fj_palacios/variables-and-data-types-in-python-18jl</guid>
      <description>&lt;p&gt;In the previous lessons you already know what Python is, you have your environment set up, and you've written your first program with &lt;code&gt;print()&lt;/code&gt;. Now it's time to take the next step: &lt;strong&gt;learn to store and manipulate information&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine you're writing a video game. You need to save the player's score, their name, whether they have lives remaining... That's what &lt;strong&gt;variables&lt;/strong&gt; are for: containers where you store information that can change while your program runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a variable?
&lt;/h2&gt;

&lt;p&gt;A variable is a &lt;strong&gt;name you give to a piece of data&lt;/strong&gt; so you can use it later. Think of it as a labeled box where you store something.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You just created three variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt; contains the text &lt;code&gt;"Ana"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;age&lt;/code&gt; contains the number &lt;code&gt;25&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;score&lt;/code&gt; contains the number &lt;code&gt;1500&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Creating a variable
&lt;/h3&gt;

&lt;p&gt;In Python, creating a variable is as simple as writing a name, the &lt;code&gt;=&lt;/code&gt; sign, and the value you want to store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to declare the data type (like in other languages). Python is smart enough to know that &lt;code&gt;"Hello, world"&lt;/code&gt; is text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using a variable
&lt;/h3&gt;

&lt;p&gt;Once created, you can use the variable by writing its name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Carlos&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Prints: Carlos
&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# Prints: 30
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use variables inside operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Prints: 40
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Variables can change
&lt;/h3&gt;

&lt;p&gt;That's where the name comes from: they're &lt;em&gt;variable&lt;/em&gt;. You can change their value at any time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Prints: 0
&lt;/span&gt;
&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Prints: 1
&lt;/span&gt;
&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Prints: 100
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rules for naming variables
&lt;/h2&gt;

&lt;p&gt;Python has some strict rules (and others that are good practices):&lt;/p&gt;

&lt;h3&gt;
  
  
  Mandatory rules
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Only letters, numbers, and underscores&lt;/strong&gt;: You can't use spaces or special symbols
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana Garcia&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# ✅ Correct
&lt;/span&gt;   &lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana Garcia&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# ❌ Error
&lt;/span&gt;   &lt;span class="n"&gt;full&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana Garcia&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# ❌ Error
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Can't start with a number&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="n"&gt;age1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;      &lt;span class="c1"&gt;# ✅ Correct
&lt;/span&gt;   &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;      &lt;span class="c1"&gt;# ❌ Error
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You can't use Python reserved words&lt;/strong&gt; (&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;, &lt;code&gt;def&lt;/code&gt;, etc.)
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;         &lt;span class="c1"&gt;# ❌ Error (for is a reserved word)
&lt;/span&gt;   &lt;span class="n"&gt;my_for&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;      &lt;span class="c1"&gt;# ✅ Correct
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Good practices (conventions)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use snake_case&lt;/strong&gt;: lowercase words separated by underscores
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="n"&gt;user_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;      &lt;span class="c1"&gt;# ✅ Preferred in Python
&lt;/span&gt;   &lt;span class="n"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;       &lt;span class="c1"&gt;# ❌ Works but not pythonic
&lt;/span&gt;   &lt;span class="n"&gt;UserName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;       &lt;span class="c1"&gt;# ❌ This is reserved for classes
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Descriptive names&lt;/strong&gt;: make it clear what the variable contains
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="n"&gt;user_age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;           &lt;span class="c1"&gt;# ✅ Clear
&lt;/span&gt;   &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;                  &lt;span class="c1"&gt;# ❌ What is "a"?
&lt;/span&gt;
   &lt;span class="n"&gt;discounted_price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;   &lt;span class="c1"&gt;# ✅ Descriptive
&lt;/span&gt;   &lt;span class="n"&gt;dp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;                 &lt;span class="c1"&gt;# ❌ Too short
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;In English (recommended)&lt;/strong&gt;: facilitates international collaboration
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="n"&gt;user_age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;           &lt;span class="c1"&gt;# ✅ Recommended
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic data types
&lt;/h2&gt;

&lt;p&gt;When you create a variable, Python automatically assigns it a &lt;strong&gt;data type&lt;/strong&gt; depending on the value you give it. The three most important types to start with are:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Integers (int)
&lt;/h3&gt;

&lt;p&gt;Numbers without decimals. Used for counting, indexes, ages, scores...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="n"&gt;players&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2026&lt;/span&gt;
&lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can do mathematical operations with them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;        &lt;span class="c1"&gt;# 15
&lt;/span&gt;&lt;span class="n"&gt;subtraction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;       &lt;span class="c1"&gt;# 5
&lt;/span&gt;&lt;span class="n"&gt;multiplication&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;    &lt;span class="c1"&gt;# 50
&lt;/span&gt;&lt;span class="n"&gt;division&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;    &lt;span class="c1"&gt;# 2.0 (note: result is float)
&lt;/span&gt;&lt;span class="n"&gt;floor_division&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="c1"&gt;# 3 (integer division, discards decimals)
&lt;/span&gt;&lt;span class="n"&gt;remainder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;       &lt;span class="c1"&gt;# 1 (remainder of division)
&lt;/span&gt;&lt;span class="n"&gt;power&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;    &lt;span class="c1"&gt;# 8 (2 to the power of 3)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Floating point numbers (float)
&lt;/h3&gt;

&lt;p&gt;Numbers with decimals. Used for measurements, prices, percentages...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;19.99&lt;/span&gt;
&lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;36.5&lt;/span&gt;
&lt;span class="n"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: In Python you use the &lt;strong&gt;dot&lt;/strong&gt; (&lt;code&gt;.&lt;/code&gt;) as decimal separator, not the comma:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;19.99&lt;/span&gt;   &lt;span class="c1"&gt;# ✅ Correct
&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;   &lt;span class="c1"&gt;# ❌ This creates a tuple, not a number
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Operations with floats:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;10.5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;2.3&lt;/span&gt;   &lt;span class="c1"&gt;# 12.8
&lt;/span&gt;&lt;span class="n"&gt;half&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;10.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;      &lt;span class="c1"&gt;# 5.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you mix &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt;, the result is always &lt;code&gt;float&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;2.5&lt;/span&gt;    &lt;span class="c1"&gt;# 12.5 (float)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Text strings (str)
&lt;/h3&gt;

&lt;p&gt;Any text goes between quotes. You can use single quotes &lt;code&gt;'...'&lt;/code&gt; or double quotes &lt;code&gt;"..."&lt;/code&gt;, it doesn't matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;surname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Garcia&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Use double quotes by default. Only use single quotes when you need double quotes inside the text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;phrase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;She said: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Concatenating strings
&lt;/h4&gt;

&lt;p&gt;You can join texts with the &lt;code&gt;+&lt;/code&gt; operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;surname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Garcia&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;surname&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Ana Garcia
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  f-strings: the modern way to format text
&lt;/h4&gt;

&lt;p&gt;Since Python 3.6 there's a much more comfortable way to include variables inside text: &lt;strong&gt;f-strings&lt;/strong&gt; (formatted strings). Put an &lt;code&gt;f&lt;/code&gt; before the quotes and write the variables inside &lt;code&gt;{}&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Carlos&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;

&lt;span class="c1"&gt;# Old way (works but ugly)
&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, my name is &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; and I am &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; years old&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Modern way with f-strings (much better!)
&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, my name is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; and I am &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; years old&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Hello, my name is Carlos and I am 30 years old
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can do operations inside the curly braces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Final price: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; euros&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Final price: 80 euros
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Booleans (bool)
&lt;/h3&gt;

&lt;p&gt;Can only have two values: &lt;code&gt;True&lt;/code&gt; (true) or &lt;code&gt;False&lt;/code&gt; (false). Used for conditions, decisions, states...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;is_adult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;has_won&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;has_discount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: &lt;code&gt;True&lt;/code&gt; and &lt;code&gt;False&lt;/code&gt; start with a &lt;strong&gt;capital letter&lt;/strong&gt;. It's mandatory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;active&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;    &lt;span class="c1"&gt;# ✅ Correct
&lt;/span&gt;&lt;span class="n"&gt;active&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt;    &lt;span class="c1"&gt;# ❌ Error (NameError)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Booleans usually come from comparisons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="n"&gt;is_adult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;    &lt;span class="c1"&gt;# True
&lt;/span&gt;
&lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
&lt;span class="n"&gt;is_cold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;    &lt;span class="c1"&gt;# True
&lt;/span&gt;
&lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="n"&gt;has_won&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;       &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checking the type of a variable
&lt;/h2&gt;

&lt;p&gt;If you're not sure of a variable's data type, use &lt;code&gt;type()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;    &lt;span class="c1"&gt;# &amp;lt;class 'str'&amp;gt;
&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;      &lt;span class="c1"&gt;# &amp;lt;class 'int'&amp;gt;
&lt;/span&gt;
&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;19.99&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;    &lt;span class="c1"&gt;# &amp;lt;class 'float'&amp;gt;
&lt;/span&gt;
&lt;span class="n"&gt;active&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;active&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;    &lt;span class="c1"&gt;# &amp;lt;class 'bool'&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is especially useful when debugging code and you want to understand what's happening.&lt;/p&gt;

&lt;h2&gt;
  
  
  Converting between types
&lt;/h2&gt;

&lt;p&gt;Sometimes you need to convert one data type to another. Python has functions for that:&lt;/p&gt;

&lt;h3&gt;
  
  
  str() — Convert to text
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="n"&gt;age_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;age_text&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; years old&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# I am 25 years old
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or better with f-strings (which does the conversion automatically):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; years old&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# I am 25 years old
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  int() — Convert to integer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 150
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ &lt;strong&gt;Careful&lt;/strong&gt;: If you try to convert something that isn't a number, Python will throw an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;abc&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# ValueError: invalid literal for int()
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  float() — Convert to decimal
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;price_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;19.99&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 19.99
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  bool() — Convert to boolean
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;is_true&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;is_true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important rule&lt;/strong&gt;: In Python, &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;""&lt;/code&gt; (empty string), &lt;code&gt;None&lt;/code&gt;, empty lists &lt;code&gt;[]&lt;/code&gt; and empty dictionaries &lt;code&gt;{}&lt;/code&gt; are considered &lt;code&gt;False&lt;/code&gt;. Everything else is &lt;code&gt;True&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hi&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical exercise
&lt;/h2&gt;

&lt;p&gt;Open your REPL (type &lt;code&gt;python&lt;/code&gt; in the terminal) and try this step by step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# 1. Create variables with personal information
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Your Name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.75&lt;/span&gt;  &lt;span class="c1"&gt;# in meters
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;student&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;span class="c1"&gt;# 2. Display the information
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Name: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Age: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; years&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Height: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; meters&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Is a student? &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;student&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 3. Do calculations
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;birth_year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2026&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Approximate birth year: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;birth_year&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 4. Check types
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;student&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 5. Convert data
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;age_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;age_text&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; years old&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 6. Experiment with operations
&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;original_price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;final_price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original_price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;original_price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original price: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;original_price&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;€&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Discount: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;discount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;%&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Final price: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;final_price&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;€&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key concepts from this lesson
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Variables&lt;/strong&gt; are named containers for storing data&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;snake_case&lt;/strong&gt; and descriptive names for your variables&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Basic data types&lt;/strong&gt; are: &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt;, &lt;code&gt;str&lt;/code&gt;, &lt;code&gt;bool&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;f-strings&lt;/strong&gt; (&lt;code&gt;f"Text {variable}"&lt;/code&gt;) are the modern way to format text&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;type()&lt;/code&gt; to check a variable's type&lt;/li&gt;
&lt;li&gt;You can convert types with &lt;code&gt;int()&lt;/code&gt;, &lt;code&gt;float()&lt;/code&gt;, &lt;code&gt;str()&lt;/code&gt;, &lt;code&gt;bool()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;In the next lesson we'll learn about &lt;strong&gt;operators and expressions&lt;/strong&gt;: how to do more complex calculations, compare values, and combine conditions. It's the foundation for making decisions in your code.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;💡 Challenge&lt;/strong&gt;: Create a program in a file &lt;code&gt;calculator.py&lt;/code&gt; that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stores two numbers in variables&lt;/li&gt;
&lt;li&gt;Calculates sum, subtraction, multiplication, and division&lt;/li&gt;
&lt;li&gt;Displays the results with f-strings in a clear way&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Number 1: 10
Number 2: 3
Sum: 13
Subtraction: 7
Multiplication: 30
Division: 3.33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Never stop coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Getting started with Git branches (II)</title>
      <dc:creator>Javi Palacios</dc:creator>
      <pubDate>Fri, 12 Jun 2026 06:17:59 +0000</pubDate>
      <link>https://dev.to/fj_palacios/getting-started-with-git-branches-ii-2ko6</link>
      <guid>https://dev.to/fj_palacios/getting-started-with-git-branches-ii-2ko6</guid>
      <description>&lt;p&gt;In the last article of this series we were explaining about Git branches, how useful they are and &lt;a href="https://dev.to/en/tutorials/getting-started-with-git-branches-1/"&gt;a theorical case of Git Branches&lt;/a&gt;, but now it's time to play with them in a real case scenario.&lt;/p&gt;

&lt;p&gt;Now our &lt;code&gt;index.html&lt;/code&gt; is less &lt;em&gt;stormy&lt;/em&gt; (Crazy, yeah!) and it has grown in structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Our wonderful Git tutorial&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Getting started with Git&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Would you like to get ninja level in Git? Stay tuned to our course!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
        But if you aren't interested in this course, we recommend you to stay tuned to updates too because we'll be
        adding posts about other different topics with no relation to this type of courses.
      &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we have an CSS (StyleSheet) as well!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Coding this is time consuming and we spent 7 hours polishing our code and creating a new design (&lt;em&gt;CSS&lt;/em&gt;), now, for our surprise, our customer call us to complain about the size of the font on the current site, as he thinks is too small for his taste. And what's the problem? Well, maybe you don't want to show your new design just yet, but still want to make him happy and not loosing your current progress.&lt;/p&gt;

&lt;p&gt;We should learned by now that we have to use two branches for these changes, as easy as &lt;code&gt;git checkout -b header-feature master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A quick explanation for what we just did, the command we used is to &lt;em&gt;clone&lt;/em&gt; the current master branch and create a new one named &lt;em&gt;header-feature&lt;/em&gt; or if you like doing it one by one there you go.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git branch header-feature master
&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout header-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;em&gt;master&lt;/em&gt; in the command we are telling Git that we want to &lt;em&gt;clone&lt;/em&gt; the repository to make a new one from it, if we use the same command but using different values, let's say &lt;code&gt;git checkout -b whatever header-feature&lt;/code&gt;, &lt;em&gt;whatever&lt;/em&gt; would be copied &lt;strong&gt;from&lt;/strong&gt; &lt;em&gt;header-feature&lt;/em&gt; and &lt;strong&gt;not&lt;/strong&gt; from master.&lt;/p&gt;

&lt;p&gt;The output for our last command would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;M       index.html
Switched to a new branch &lt;span class="s1"&gt;'header-feature'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now if we try our beloved &lt;code&gt;git status&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;On branch header-feature
Changes not staged &lt;span class="k"&gt;for &lt;/span&gt;commit:
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add &amp;lt;file&amp;gt;..."&lt;/span&gt; to update what will be committed&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git checkout -- &amp;lt;file&amp;gt;..."&lt;/span&gt; to discard changes &lt;span class="k"&gt;in &lt;/span&gt;working directory&lt;span class="o"&gt;)&lt;/span&gt;

        modified:   index.html

Untracked files:
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add &amp;lt;file&amp;gt;..."&lt;/span&gt; to include &lt;span class="k"&gt;in &lt;/span&gt;what will be committed&lt;span class="o"&gt;)&lt;/span&gt;

        css.css

no changes added to commit &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add"&lt;/span&gt; and/or &lt;span class="s2"&gt;"git commit -a"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git let's us now &lt;code&gt;index.html&lt;/code&gt; was modified and a new file named &lt;code&gt;css.css&lt;/code&gt; was created as well.&lt;br&gt;
Easy to fix with &lt;code&gt;git add . &amp;amp;&amp;amp; git commit -m "Fancy new header with 10000 man hours work"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;header-feature c7a9e08] Fancy new header with 10000 man hours work
 2 files changed, 28 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;, 5 deletions&lt;span class="o"&gt;(&lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 css.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now if we do a &lt;code&gt;git checkout master&lt;/code&gt; we have our site as before we modified anything. Let's do the changes our client requested. Now we know what to do: &lt;code&gt;git checkout -b changing-font-size master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And this is what our &lt;code&gt;index.html&lt;/code&gt; looks like now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Our wonderful Git tutorial&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Getting started with Git&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Would you like to get ninja level in Git? Stay tuned to our course!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
        But if you aren't interested in this course, we recommend you to stay tuned to updates too because we'll be
        adding posts about other different topics with no relation to this type of courses
      &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And our &lt;code&gt;css.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With something this easy, we make our client happy. Now let's save it with &lt;code&gt;git add . &amp;amp;&amp;amp; git commit -m "Changing the font-size of our website"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;changing-font-size 71e3aef] Changing the font-size of our website
 2 files changed, 11 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;, 5 deletions&lt;span class="o"&gt;(&lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 css.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything we changed is on &lt;em&gt;changing-font-size&lt;/em&gt;, if we move to &lt;em&gt;master&lt;/em&gt; we will have our initial website and now that our customer told us he was happy as a rainbow with the font size, we &lt;em&gt;merge&lt;/em&gt; those changes from &lt;em&gt;changing-font-size&lt;/em&gt; to &lt;em&gt;master&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout master
&lt;span class="nv"&gt;$ &lt;/span&gt;git merge changing-font-size

Updating 497f0c9..71e3aef
Fast-forward
 css.css    |  3 +++
 index.html | 13 ++++++++-----
 2 files changed, 11 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;, 5 deletions&lt;span class="o"&gt;(&lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 css.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;em&gt;merge&lt;/em&gt; we combine the changes from both repositories, in &lt;em&gt;Fast-forward&lt;/em&gt; mode, the most common &lt;em&gt;merging&lt;/em&gt; branches method, Git detects the changes doesn't make any conflict and combine them perfectly. We have the changes from &lt;em&gt;changing-font-size&lt;/em&gt; in &lt;em&gt;master&lt;/em&gt; but still we have to &lt;em&gt;merge&lt;/em&gt; those changes to &lt;em&gt;header-feature&lt;/em&gt;. Sometimes it can happen (It really does...) we forget what branches we have… don't worry! simply type: &lt;code&gt;git branch&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  changing-font-size
  header-feature
&lt;span class="k"&gt;*&lt;/span&gt; master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see (or read… anyway…), Git gives us a list of all the branches we currently have and on top of that marks with an asterisk which branch is active. Let's do this!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout header-feature
&lt;span class="nv"&gt;$ &lt;/span&gt;git merge changing-font-size

Auto-merging index.html
CONFLICT &lt;span class="o"&gt;(&lt;/span&gt;content&lt;span class="o"&gt;)&lt;/span&gt;: Merge conflict &lt;span class="k"&gt;in &lt;/span&gt;index.html
Auto-merging css.css
CONFLICT &lt;span class="o"&gt;(&lt;/span&gt;add/add&lt;span class="o"&gt;)&lt;/span&gt;: Merge conflict &lt;span class="k"&gt;in &lt;/span&gt;css.css
Automatic merge failed&lt;span class="p"&gt;;&lt;/span&gt; fix conflicts and &lt;span class="k"&gt;then &lt;/span&gt;commit the result.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jesus Christ… We broke it… What happened? Git detects the files from one branch to the other conflicts between them but Git is a professional tool and knows how guide us on fixing it. Our &lt;code&gt;index.html&lt;/code&gt; looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Our wonderful Git tutorial&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="na"&gt;HEAD&lt;/span&gt;
        &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="na"&gt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Getting started with Git&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Would you like to get ninja level in Git? Stay tuned to our course!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;But if you aren't interested in this course, we recommend you to
            stay tuned to updates too because we'll be adding posts about other
            different topics with no relation to this type of courses.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
=======
        &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Getting started with Git&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Would you like to get ninja level in Git? Stay tuned to our course!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;But if you aren't interested in this course, we recommend you to
            stay tuned to updates too because we'll be adding posts about other
            different topics with no relation to this type of courses&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; changing-font-size
        &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, Git indicates us where the conflict between the files is coming from. With small work, we fix our file and give it this look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Our wonderful Git tutorial&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Getting started with Git&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Would you like to get ninja level in Git? Stay tuned to our course!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
        But if you aren't interested in this course, we recommend you to stay tuned to updates too because we'll be
        adding posts about other different topics with no relation to this type of courses.
      &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And our CSS file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="nt"&gt;HEAD&lt;/span&gt;
&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;=======&lt;/span&gt;
&lt;span class="err"&gt;.main&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;changing-font-size&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With some small work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We just need to save the changes with &lt;code&gt;git add .&lt;/code&gt; and this time, as we are merging two branches, if we don't write any commit message, Git adds automatically &lt;em&gt;Merge branch 'changing-font-size' into header-feature&lt;/em&gt; with a simple &lt;code&gt;git commit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;header-feature 44e74a6] Merge branch &lt;span class="s1"&gt;'changing-font-size'&lt;/span&gt; into header-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the already know to apply our fancy header to the branch master just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout master
&lt;span class="nv"&gt;$ &lt;/span&gt;git merge header-feature

Updating 71e3aef..44e74a6
Fast-forward
 css.css    | 15 +++++++++++++++
 index.html | 11 +++++++----
 2 files changed, 22 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;, 4 deletions&lt;span class="o"&gt;(&lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This time, spotless, no problem at all, common &lt;em&gt;merge&lt;/em&gt; in &lt;em&gt;Fast-forward&lt;/em&gt; mode. And now, we don't need to look like a &lt;em&gt;cheapskater&lt;/em&gt; and keep useless things with us! Let's delete useless branches from our project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; changing-font-size
&lt;span class="nv"&gt;$ &lt;/span&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; header-feature

Deleted branch changing-font-size &lt;span class="o"&gt;(&lt;/span&gt;was 71e3aef&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Deleted branch header-feature &lt;span class="o"&gt;(&lt;/span&gt;was 44e74a6&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope your need for knowledge of &lt;em&gt;Git branches&lt;/em&gt; is fulfilled!&lt;/p&gt;

&lt;p&gt;Never stop programming!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
