<?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: Hodard Hazwinayo</title>
    <description>The latest articles on DEV Community by Hodard Hazwinayo (@hodardhazwinayo).</description>
    <link>https://dev.to/hodardhazwinayo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F917966%2Fb904e213-0d3c-47e9-8e96-0231c52bf72b.jpeg</url>
      <title>DEV Community: Hodard Hazwinayo</title>
      <link>https://dev.to/hodardhazwinayo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hodardhazwinayo"/>
    <language>en</language>
    <item>
      <title>SRE vs DevOps vs Sys Admin vs Cloud engineer</title>
      <dc:creator>Hodard Hazwinayo</dc:creator>
      <pubDate>Mon, 03 Oct 2022 17:11:11 +0000</pubDate>
      <link>https://dev.to/hodardhazwinayo/sre-vs-devops-vs-sys-admin-vs-cloud-engineer-omm</link>
      <guid>https://dev.to/hodardhazwinayo/sre-vs-devops-vs-sys-admin-vs-cloud-engineer-omm</guid>
      <description>&lt;p&gt;**&lt;/p&gt;

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

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Site Reliability Engineering&lt;/strong&gt;, or &lt;strong&gt;SRE&lt;/strong&gt;, is an approach developed by Google in 2003 to continuously deploy new features while maintaining a high level of quality and availability of the infrastructure.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;SRE&lt;/strong&gt; has become a full-fledged IT domain, whose objectives are to ensure that the platform is reliable and stable, ensure regular delivery of features and develop automated solutions for operational aspects. An SRE, according to Google's philosophy, is not allowed to do more than 50% of functional tasks. Like &lt;strong&gt;DevOps, this philosophy&lt;/strong&gt; has led to the creation of a position, the Site Reliability Engineer. This SRE position is a continuation of the DevOps philosophy and is the "new DevOps."&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

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

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;DevOps&lt;/strong&gt; is often seen as a way to apply &lt;strong&gt;agility to the production&lt;/strong&gt; world. The agile method is used to reduce the distance between user needs and the development team. DevOps is the contraction of Devs and Ops because this methodology pushes Devs and Ops to collaborate to put new features into production faster. The notion of security is sometimes integrated to implement an approach called DevSecOps.&lt;/p&gt;

&lt;p&gt;If &lt;strong&gt;DevOps is a philosophy&lt;/strong&gt;, DevOps can be a job title (even if the term DevOps engineer is sometimes controversial). When we talk about a DevOps engineer, we are talking about &lt;strong&gt;a person who reconciles the stability of the platform and the approach of putting developers&lt;/strong&gt; in the best conditions to produce quality features quickly. Their tasks range from automating processes to helping resolve bugs and optimizing platform monitoring.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sr1h_lf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tgqynqtl5ec89irxgvm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sr1h_lf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tgqynqtl5ec89irxgvm.PNG" alt="Image description" width="880" height="382"&gt;&lt;/a&gt;&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  How to choose between SRE and DevOps for your company?
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Originally, SRE and DevOps were concepts, a way of working.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today, these terms have become the name of the people working with this philosophy. You don't have to choose between these two profiles to recruit your internal Ops. &lt;strong&gt;SRE is a way to accomplish the DevOps philosophy and implement it,&lt;/strong&gt; with specific standards and metrics defined by Google. But both &lt;strong&gt;SRE and DevOps&lt;/strong&gt; remove organizational barriers to deliver faster while ensuring platform stability. &lt;/p&gt;

&lt;p&gt;On the contrary, if you want to implement the Google SRE standards in your company, recruiting and training DevOps people should not be a problem because they will already share the concepts.&lt;br&gt;
This topic is developed in depth by Google in &lt;a href="https://www.youtube.com/watch?v=uTEL8Ff1Zvk"&gt;this video&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a SysAdmin compared to DevOps and SRE?
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
The prominent role of the &lt;strong&gt;SysAdmin (or computer systems administrator)&lt;/strong&gt; is to ensure the proper functioning of the computer servers of an entity or a system. The missions entrusted to him vary according to the size of the company: optimization of system resources, availability of servers, management of backups, resolution of problems and security breaches, maintenance…&lt;/p&gt;

&lt;p&gt;The term SysAdmin defines system administrators when servers are still mainly physical. The transformation of IT and networks with the evolution of the possibilities offered by the technical environment (especially Cloud) has radically transformed the role and functions of the SysAdmin. Some &lt;strong&gt;Sysadmins have embarked on a DevOps approach&lt;/strong&gt;. If the job of DevOps engineer has been widely developed, Sysadmin remains a widespread function, especially in companies that have barriers to move to the Cloud.&lt;/p&gt;

&lt;p&gt;Finally, the objective of DevOps is to ensure collaboration between each part of an IT company (&lt;strong&gt;Devs and Ops&lt;/strong&gt;). A &lt;strong&gt;SysAdmin, on the other hand, is more focused on the configuration and maintenance of servers and computer systems.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Cloud engineer?
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Cloud Computing&lt;/strong&gt; is a data storage service accessible via the Internet. The &lt;strong&gt;Cloud engineer&lt;/strong&gt; is in charge of &lt;strong&gt;deploying, storing, and managing data on servers located outside the company in data centers. He is a specialist in cloud technologies and services offered by the major cloud providers&lt;/strong&gt;. He can be specialized in one of the big public clouds (AWS, GCP) and have several experiences with different providers. They generally master the concepts of &lt;strong&gt;containerization, automation, and CI/CD,&lt;/strong&gt; allowing them to support developers and implement a DevOps approach in the company.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SRE, DevOps,&lt;/strong&gt; and &lt;strong&gt;Cloud engineers&lt;/strong&gt; are today several names that refer to the &lt;strong&gt;same concepts. Automation, collaboration with developers, and mastery of cloud tools&lt;/strong&gt;. Even in companies where DevOps are called "SRE," we find more a DevOps role with a different terminology than an actual application of the Google methodology. On the other hand, the position, culture, and technologies of a &lt;strong&gt;SysAdmin are very different from those of these "new generation" Ops.&lt;/strong&gt; When recruiting, it is this distinction that you need to pay attention to in order to ensure that the person you are recruiting has the culture of the role to which you are going to assign them.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Git Cheat Sheet – 50 Git Commands You Should Know</title>
      <dc:creator>Hodard Hazwinayo</dc:creator>
      <pubDate>Tue, 30 Aug 2022 14:26:46 +0000</pubDate>
      <link>https://dev.to/hodardhazwinayo/git-cheat-sheet-50-git-commands-you-should-know-5315</link>
      <guid>https://dev.to/hodardhazwinayo/git-cheat-sheet-50-git-commands-you-should-know-5315</guid>
      <description>&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a distributed version control system that helps developers collaborate on projects of any scale.&lt;/p&gt;

&lt;p&gt;Linus Torvalds, the developer of the Linux kernel, created Git in 2005 to help control the Linux kernel's development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Distributed Version Control System?
&lt;/h2&gt;

&lt;p&gt;A distributed version control system is a system that helps you keep track of changes you've made to files in your project.&lt;/p&gt;

&lt;p&gt;This change history lives on your local machine and lets you revert to a previous version of your project with ease in case something goes wrong.&lt;/p&gt;

&lt;p&gt;Git makes collaboration easy. Everyone on the team can keep a full backup of the repositories they're working on on their local machine. Then, thanks to an external server like &lt;strong&gt;BitBucket&lt;/strong&gt;, GitHub or GitLab, they can safely store the repository in a single place.&lt;/p&gt;

&lt;p&gt;This way, different members of the team can copy it locally and everyone has a clear overview of all changes made by the whole team.&lt;/p&gt;

&lt;p&gt;Git has many different commands you can use. And I've found that these fifty are the ones I use the most often (and are therefore the most helpful to remember).&lt;/p&gt;

&lt;p&gt;So I have written them down and thought it'd be nice to share them with the community. I hope you find them useful – Enjoy.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check your Git configuration:
&lt;/h2&gt;

&lt;p&gt;The command below returns a list of information about your git configuration including user name and email:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How to setup your Git username:&lt;br&gt;
With the command below you can configure your user name:&lt;/p&gt;

&lt;p&gt;git config --global user.name "Fabio"&lt;br&gt;
How to setup your Git user email:&lt;br&gt;
This command lets you setup the user email address you'll use in your commits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "hodardhazwinayo@test.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to cache your login credentials in Git:
&lt;/h2&gt;

&lt;p&gt;You can store login credentials in the cache so you don't have to type them in each time. Just use this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global credential.helper cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to initialize a Git repo:
&lt;/h2&gt;

&lt;p&gt;Everything starts from here. The first step is to initialize a new Git repo locally in your project root. You can do so with the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to add a file to the staging area in Git:
&lt;/h2&gt;

&lt;p&gt;The command below will add a file to the staging area. Just replace filename_here with the name of the file you want to add to the staging area.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add filename_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to add all files in the staging area in Git
&lt;/h2&gt;

&lt;p&gt;If you want to add all files in your project to the staging area, you can use a wildcard . and every file will be added for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to add only certain files to the staging area in Git
&lt;/h2&gt;

&lt;p&gt;With the asterisk in the command below, you can add all files starting with 'fil' in the staging area.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add fil*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to check a repository's status in Git:
&lt;/h2&gt;

&lt;p&gt;This command will show the status of the current repository including staged, unstaged, and untracked files.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to commit changes in the editor in Git:
&lt;/h2&gt;

&lt;p&gt;This command will open a text editor in the terminal where you can write a full commit message.&lt;/p&gt;

&lt;p&gt;A commit message is made up of a short summary of changes, an empty line, and a full description of the changes after it.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to commit changes with a message in Git:
&lt;/h2&gt;

&lt;p&gt;You can add a commit message without opening the editor. This command lets you only specify a short summary for your commit message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "your commit message here"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to commit changes (and skip the staging area) in Git:
&lt;/h2&gt;

&lt;p&gt;You can add and commit tracked files with a single command by using the -a and -m options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -a -m"your commit message here"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see your commit history in Git:
&lt;/h2&gt;

&lt;p&gt;This command shows the commit history for the current repository:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see your commit history including changes in Git:
&lt;/h2&gt;

&lt;p&gt;This command shows the commit's history including all files and their changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see a specific commit in Git:
&lt;/h2&gt;

&lt;p&gt;This command shows a specific commit.&lt;/p&gt;

&lt;p&gt;Replace commit-id with the id of the commit that you find in the commit log after the word commit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git show commit-id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see log stats in Git:
&lt;/h2&gt;

&lt;p&gt;This command will cause the Git log to show some statistics about the changes in each commit, including line(s) changed and file names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --stat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see changes made before committing them using "diff" in Git:
&lt;/h2&gt;

&lt;p&gt;You can pass a file as a parameter to only see changes on a specific file.&lt;br&gt;
git diff shows only unstaged changes by default.&lt;/p&gt;

&lt;p&gt;We can call diff with the --staged flag to see any staged changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff
git diff all_checks.py
git diff --staged
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see changes using "git add -p":
&lt;/h2&gt;

&lt;p&gt;This command opens a prompt and asks if you want to stage changes or not, and includes other options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to remove tracked files from the current working tree in Git:
&lt;/h2&gt;

&lt;p&gt;This command expects a commit message to explain why the file was deleted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to rename files in Git:
&lt;/h2&gt;

&lt;p&gt;This command stages the changes, then it expects a commit message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git mv oldfile newfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to ignore files in Git:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a .gitignore file and commit it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to revert unstaged changes in Git:
&lt;/h2&gt;



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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to revert staged changes in Git:
&lt;/h2&gt;

&lt;p&gt;You can use the -p option flag to specify the changes you want to reset.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset HEAD filename
git reset HEAD -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to amend the most recent commit in Git:
&lt;/h2&gt;

&lt;p&gt;git commit --amend allows you to modify and add changes to the most recent commit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;!!Note!!: fixing up a local commit with amend is great and you can push it to a shared repository after you've fixed it. But you should avoid amending commits that have already been made public.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to rollback the last commit in Git:
&lt;/h2&gt;

&lt;p&gt;git revert will create a new commit that is the opposite of everything in the given commit.&lt;br&gt;
We can revert the latest commit by using the head alias like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to rollback an old commit in Git:
&lt;/h2&gt;

&lt;p&gt;You can revert an old commit using its commit id. This opens the editor so you can add a commit message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert comit_id_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to create a new branch in Git:
&lt;/h2&gt;

&lt;p&gt;By default, you have one branch, the main branch. With this command, you can create a new branch. Git won't switch to it automatically – you will need to do it manually with the next command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to switch to a newly created branch in Git:
&lt;/h2&gt;

&lt;p&gt;When you want to use a different or a newly created branch you can use this command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to list branches in Git:
&lt;/h2&gt;

&lt;p&gt;You can view all created branches using the git branch command. It will show a list of all branches and mark the current branch with an asterisk and highlight it in green.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to create a branch in Git and switch to it immediately:
&lt;/h2&gt;

&lt;p&gt;In a single command, you can create and switch to a new branch right away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b branch_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to delete a branch in Git:
&lt;/h2&gt;

&lt;p&gt;When you are done working with a branch and have merged it, you can delete it using the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to merge two branches in Git:
&lt;/h2&gt;

&lt;p&gt;To merge the history of the branch you are currently in with the &lt;strong&gt;branch_name&lt;/strong&gt;, you will need to use the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to show the commit log as a graph in Git:
&lt;/h2&gt;

&lt;p&gt;We can use --graph to get the commit log to show as a graph. Also,&lt;br&gt;
--oneline will limit commit messages to a single line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --graph --oneline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to show the commit log as a graph of all branches in Git:
&lt;/h2&gt;

&lt;p&gt;Does the same as the command above, but for all branches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --graph --oneline --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to abort a conflicting merge in Git:
&lt;/h2&gt;

&lt;p&gt;If you want to throw a merge away and start over, you can run the following command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to add a remote repository in Git
&lt;/h2&gt;

&lt;p&gt;This command adds a remote repository to your local repository (&lt;strong&gt;just replace &lt;a href="https://repo_here"&gt;https://repo_here&lt;/a&gt; with your remote repo URL&lt;/strong&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add remote https://repo_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to see remote URLs in Git:
&lt;/h2&gt;

&lt;p&gt;You can see all remote repositories for your local repository with this command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to get more info about a remote repo in Git:
&lt;/h2&gt;

&lt;p&gt;Just replace origin with the name of the remote obtained by&lt;br&gt;
running the git remote -v command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to push changes to a remote repo in Git:
&lt;/h2&gt;

&lt;p&gt;When all your work is ready to be saved on a remote repository, you can push all changes using the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to pull changes from a remote repo in Git:
&lt;/h2&gt;

&lt;p&gt;If other team members are working on your repository, you can retrieve the latest changes made to the remote repository with the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to check remote branches that Git is tracking:
&lt;/h2&gt;

&lt;p&gt;This command shows the name of all remote branches that Git is tracking for the current repository:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to fetch remote repo changes in Git:
&lt;/h2&gt;

&lt;p&gt;This command will download the changes from a remote repo but will not perform a merge on your local branch (as git pull does that instead).&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;How to check the current commits log of a remote repo in Git&lt;br&gt;
Commit after commit, Git builds up a log. You can find out the remote repository log by using this command:&lt;/p&gt;
&lt;h2&gt;
  
  
  git log origin/main
&lt;/h2&gt;
&lt;h2&gt;
  
  
  How to merge a remote repo with your local repo in Git:
&lt;/h2&gt;

&lt;p&gt;If the remote repository has changes you want to merge with your local, then this command will do that for you:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to get the contents of remote branches in Git without automatically merging:
&lt;/h2&gt;

&lt;p&gt;This lets you update the remote without merging any content into the&lt;br&gt;
local branches. You can call git merge or git checkout to do the merge.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to push a new branch to a remote repo in Git:
&lt;/h2&gt;

&lt;p&gt;If you want to push a branch to a remote repository you can use the command below. Just remember to add -u to create the branch upstream:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to remove a remote branch in Git:
&lt;/h2&gt;

&lt;p&gt;If you no longer need a remote branch you can remove it using the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to use Git rebase:
&lt;/h2&gt;

&lt;p&gt;You can transfer completed work from one branch to another using git rebase.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Git Rebase can get really messy if you don't do it properly. Before using this command I suggest that you re-read the official documentation here&lt;/p&gt;

&lt;h2&gt;
  
  
  How to run rebase interactively in Git:
&lt;/h2&gt;

&lt;p&gt;You can run git rebase interactively using the -i flag.&lt;br&gt;
It will open the editor and present a set of commands you can use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git rebase -i master&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to force a push request in Git:&lt;/strong&gt;&lt;br&gt;
This command will force a push request. This is usually fine for pull request branches because nobody else should have cloned them.&lt;br&gt;
But this isn't something that you want to do with public repos.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

&lt;p&gt;These commands can dramatically improve your productivity in Git. You don't have to remember them all – that's why I have written this cheat sheet. &lt;/p&gt;

&lt;p&gt;Thanks for reading! By the way, I am &lt;strong&gt;Hodard Hazwinayo&lt;/strong&gt;, &lt;strong&gt;Senior Infrastructure Engineer and Senior DevOps Engineer&lt;/strong&gt; in IT automation with Python &amp;amp; Bash Script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/hodard-hazwinayo-259546109/"&gt;Follow me Here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>programming</category>
      <category>it</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
