<?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: Lisa Tagliaferri</title>
    <description>The latest articles on DEV Community by Lisa Tagliaferri (@lisaironcutter).</description>
    <link>https://dev.to/lisaironcutter</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%2F65055%2F5b913d4b-343a-4689-a157-916affce8d76.jpeg</url>
      <title>DEV Community: Lisa Tagliaferri</title>
      <link>https://dev.to/lisaironcutter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lisaironcutter"/>
    <language>en</language>
    <item>
      <title>Happy Hacktoberfest from Sourcegraph 🍂</title>
      <dc:creator>Lisa Tagliaferri</dc:creator>
      <pubDate>Tue, 05 Oct 2021 21:16:10 +0000</pubDate>
      <link>https://dev.to/sourcegraph/happy-hacktoberfest-from-sourcegraph-2dc3</link>
      <guid>https://dev.to/sourcegraph/happy-hacktoberfest-from-sourcegraph-2dc3</guid>
      <description>&lt;p&gt;We on the Sourcegraph team are so excited to be a Hacktoberfest Community Partner to celebrate open source throughout October. &lt;/p&gt;

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

&lt;p&gt;Partnering with the community to invite more developers into open source is really important to us, and we are so thrilled to welcome contributors to open pull requests on our repositories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accepting contributors to Sourcegraph
&lt;/h2&gt;

&lt;p&gt;The Sourcegraph team has put together a &lt;a href="https://github.com/orgs/sourcegraph/projects/210" rel="noopener noreferrer"&gt;Good First Issues GitHub board&lt;/a&gt; that will help Hacktoberfest contributors be able to contribute to our repos.&lt;/p&gt;

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

&lt;p&gt;In the board, you will find a number of Issues across different technologies, as well as technical troubleshooting tutorials that you can contribute to &lt;a href="https://learn.sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Learn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We also have a &lt;a href="//srcgr.ph/hacktoberfest-guide"&gt;contributing guide&lt;/a&gt; in the main sourcegraph/sourcegraph repository to support you in making pull requests on the project. &lt;/p&gt;

&lt;h2&gt;
  
  
  Give back to the community by helping devs recover from errors
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://learn.sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Learn&lt;/a&gt; is participating in Hacktoberfest through inviting the community to contribute troubleshooting tutorials in popular programming languages and more. &lt;/p&gt;

&lt;p&gt;Check out our &lt;a href="https://github.com/sourcegraph/learn/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" rel="noopener noreferrer"&gt;open issues&lt;/a&gt; to review what we are looking for help with this month.&lt;/p&gt;

&lt;p&gt;We have a dedicated &lt;a href="https://github.com/sourcegraph/learn/blob/main/docs/hacktoberfest-2021.md" rel="noopener noreferrer"&gt;Hacktoberfest 2021 contributor guide&lt;/a&gt; that provides step-by-step directions so you can open up your pull request and contribute directly to open source and help developers troubleshoot their code! &lt;/p&gt;

&lt;h2&gt;
  
  
  Earn Sourcegraph swag
&lt;/h2&gt;

&lt;p&gt;For Hacktoberfest 2021, we are happy to share that we will be offering the first 50 successfully merged pull request contributors with a Sourcegraph swag package. We'll provide details to contributors directly. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Catch our presentation as part of the &lt;a href="https://youtu.be/XX0hOoSaI8Q?t=6271" rel="noopener noreferrer"&gt;Hacktoberfest KickOff celebration&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>sourcegraph</category>
    </item>
    <item>
      <title>How To Install WordPress on Ubuntu 20.04 with a LAMP Stack</title>
      <dc:creator>Lisa Tagliaferri</dc:creator>
      <pubDate>Wed, 08 Jul 2020 17:55:44 +0000</pubDate>
      <link>https://dev.to/digitalocean/how-to-install-wordpress-on-ubuntu-20-04-with-a-lamp-stack-3pci</link>
      <guid>https://dev.to/digitalocean/how-to-install-wordpress-on-ubuntu-20-04-with-a-lamp-stack-3pci</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;WordPress is an extremely popular open-source technology for making websites and blogs on the internet today. Used by 63% of all websites that use a content management system (CMS), WordPress sites represent 36% of all websites that are currently online. &lt;/p&gt;

&lt;p&gt;There are many different approaches to getting access to WordPress and some setup processes are more complex than others. This tutorial is intended for those who desire to install and administer a Wordpress instance on an unmanaged cloud server via the command line. Though this approach requires more steps than a ready-made WordPress installation, it offers administrators greater control over their WordPress environment. &lt;/p&gt;

&lt;p&gt;Depending on your needs and goals, you may find other options that are more suitable. As open-source software, WordPress can be freely downloaded and installed, but to be available on the web, you will likely need to purchase cloud infrastructure and a domain name. Continue following this guide if you are interested in working through the server-side installation and set up of a WordPress site.&lt;/p&gt;

&lt;p&gt;This tutorial will be using a LAMP (&lt;strong&gt;L&lt;/strong&gt;inux, &lt;strong&gt;A&lt;/strong&gt;pache, &lt;strong&gt;M&lt;/strong&gt;ySQL, and &lt;strong&gt;P&lt;/strong&gt;HP) stack, which is one option for a server architecture that supports WordPress by providing the Linux operating system, Apache web server, MySQL database, and PHP programming language. We’ll install and set up WordPress via LAMP on a Linux Ubuntu 20.04 server. &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;In order to complete this tutorial, you will need access to an Ubuntu 20.04 server and will need to complete these steps before beginning this guide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up your server by following our &lt;a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04" rel="noopener noreferrer"&gt;Ubuntu 20.04 initial server setup guide&lt;/a&gt;, and ensure you have a non-root &lt;code&gt;sudo&lt;/code&gt; user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install a LAMP stack&lt;/strong&gt; by following our &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04" rel="noopener noreferrer"&gt;LAMP guide&lt;/a&gt; to install and configure this software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure your site&lt;/strong&gt;: WordPress takes in user input and stores user data, so it is important for it to have a layer of security. TLS/SSL is the technology that allows you to encrypt the traffic from your site so that your and your users’ connection is secure. Here are two options available to you to meet this requirement:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you have a domain name...&lt;/strong&gt; you can secure your site with Let’s Encrypt, which provides free, trusted certificates. Follow our &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04" rel="noopener noreferrer"&gt;Let’s Encrypt guide for Apache&lt;/a&gt; to set this up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you do not have a domain...&lt;/strong&gt; and you are just using this configuration for testing or personal use, you can use a self-signed certificate instead. This provides the same type of encryption, but without the domain validation. Follow our &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-18-04" rel="noopener noreferrer"&gt;self-signed SSL guide for Apache&lt;/a&gt; to get set up.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;When you are finished with the setup steps, log into your server as your &lt;code&gt;sudo&lt;/code&gt; user and continue below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — Creating a MySQL Database and User for WordPress
&lt;/h2&gt;

&lt;p&gt;The first step that we will take is a preparatory one. WordPress uses MySQL to manage and store site and user information. We have MySQL installed already, but we need to make a database and a user for WordPress to use.&lt;/p&gt;

&lt;p&gt;To get started, log into the MySQL root (administrative) account by issuing this command (note that this is not the root user of your server):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will be prompted for the password you set for the MySQL root account when you installed the software.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you cannot access your MySQL database via root, as a &lt;code&gt;sudo&lt;/code&gt; user you can update your root user’s password by logging into the database like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql -u root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you receive the MySQL prompt, you can update the root user’s password. Here, replace &lt;code&gt;new_password&lt;/code&gt; with a strong password of your choosing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password'; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may now type &lt;code&gt;EXIT;&lt;/code&gt; and can log back into the database via password with 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;mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Within the database, we can create an exclusive database for WordPress to control. You can call this whatever you would like, but we will be using the name &lt;strong&gt;wordpress&lt;/strong&gt; in this guide. Create the database for WordPress by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Every MySQL statement must end in a semi-colon (&lt;code&gt;;&lt;/code&gt;). Check to make sure this is present if you are running into any issues.&lt;/p&gt;

&lt;p&gt;Next, we are going to create a separate MySQL user account that we will use exclusively to operate our new database. Creating specific databases and accounts can support us from a management and security standpoint. We will use the name &lt;strong&gt;wordpressuser&lt;/strong&gt; in this guide, but feel free to use whatever name is relevant for you.&lt;/p&gt;

&lt;p&gt;We are going to create this account, set a password, and grant access to the database we created. We can do this by typing the following command. Remember to choose a strong password here for your database user where we have &lt;code&gt;password&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE USER 'wordpressuser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let the database know that our &lt;strong&gt;wordpressuser&lt;/strong&gt; should have complete access to the database we set up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRANT ALL ON wordpress.* TO 'wordpressuser'@'%';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have a database and user account, each made specifically for WordPress. We need to flush the privileges so that the current instance of MySQL knows about the recent changes we’ve made:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Exit out of MySQL by typing:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;In the next step, we’ll lay some foundations for WordPress plugins by downloading PHP extensions for our server. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Installing Additional PHP Extensions
&lt;/h2&gt;

&lt;p&gt;When setting up our LAMP stack, we only required a very minimal set of extensions in order to get PHP to communicate with MySQL. WordPress and many of its plugins leverage additional PHP extensions.&lt;/p&gt;

&lt;p&gt;We can download and install some of the most popular PHP extensions for use with WordPress by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will lay the groundwork for installing additional plugins into our WordPress site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Each WordPress plugin has its own set of requirements. Some may require additional PHP packages to be installed. Check your plugin documentation to discover its PHP requirements. If they are available, they can be installed with &lt;code&gt;apt&lt;/code&gt; as demonstrated above.&lt;/p&gt;

&lt;p&gt;We will need to restart Apache to load these new extensions, we’ll be doing more configurations on Apache in the next section, so you can wait until then, or restart now to complete the PHP extension process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3 — Adjusting Apache's Configuration to Allow for .htaccess Overrides and Rewrites
&lt;/h2&gt;

&lt;p&gt;Next, we will be making a few minor adjustments to our Apache configuration. Based on the prerequisite tutorials, you should have a configuration file for your site in the &lt;code&gt;/etc/apache2/sites-available/&lt;/code&gt; directory. &lt;/p&gt;

&lt;p&gt;In this guide, we'll use &lt;code&gt;/etc/apache2/sites-available/wordpress.conf&lt;/code&gt; as an example here, but you should substitute the path to your configuration file where appropriate. Additionally, we will use &lt;code&gt;/var/www/wordpress&lt;/code&gt; as the root directory of our WordPress install. You should use the web root specified in your own configuration. If you followed our &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04" rel="noopener noreferrer"&gt;LAMP tutorial&lt;/a&gt;, it may be your domain name instead of &lt;code&gt;wordpress&lt;/code&gt; in both of these instances. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; It's possible you are using the &lt;code&gt;000-default.conf&lt;/code&gt; default configuration (with &lt;code&gt;/var/www/html&lt;/code&gt; as your web root). This is fine to use if you’re only going to host one website on this server. If not, it’s better to split the necessary configuration into logical chunks, one file per site.&lt;/p&gt;

&lt;p&gt;With our paths identified, we can move onto working with &lt;code&gt;.htaccess&lt;/code&gt; so that Apache can handle configuration changes on a per-directory basis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling .htaccess Overrides
&lt;/h3&gt;

&lt;p&gt;Currently, the use of &lt;code&gt;.htaccess&lt;/code&gt; files is disabled. WordPress and many WordPress plugins use these files extensively for in-directory tweaks to the web server’s behavior.&lt;/p&gt;

&lt;p&gt;Open the Apache configuration file for your website with a text editor like nano.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/apache2/sites-available/wordpress.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To allow &lt;code&gt;.htaccess&lt;/code&gt; files, we need to set the &lt;code&gt;AllowOverride&lt;/code&gt; directive within a &lt;code&gt;Directory&lt;/code&gt; block pointing to our document root. Add the following block of text inside the &lt;code&gt;VirtualHost&lt;/code&gt; block in your configuration file, making sure to use the correct web root directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Directory /var/www/wordpress/&amp;gt;
    AllowOverride All
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you are finished, save and close the file. In nano, you can do this by pressing &lt;code&gt;CTRL&lt;/code&gt; and &lt;code&gt;X&lt;/code&gt; together, then &lt;code&gt;Y&lt;/code&gt;, then &lt;code&gt;ENTER&lt;/code&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling the Rewrite Module
&lt;/h3&gt;

&lt;p&gt;Next, we can enable &lt;code&gt;mod_rewrite&lt;/code&gt; so that we can utilize the WordPress permalink feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo a2enmod rewrite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows you to have more human-readable permalinks to your posts, like the following two examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://example.com/2012/post-name/
http://example.com/2012/12/30/post-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;a2enmod&lt;/code&gt; command calls a script that enables the specified module within the Apache configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling the Changes
&lt;/h3&gt;

&lt;p&gt;Before we implement the changes we’ve made, check to make sure we haven’t made any syntax errors by running the following test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apache2ctl configtest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may receive output like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you wish to suppress the top line, just add a &lt;code&gt;ServerName&lt;/code&gt; directive to your main (global) Apache configuration file at &lt;code&gt;/etc/apache2/apache2.conf&lt;/code&gt;. The &lt;code&gt;ServerName&lt;/code&gt; can be your server’s domain or IP address. This is just a message, however, and doesn’t affect the functionality of your site. As long as the output contains &lt;code&gt;Syntax OK&lt;/code&gt;, you are ready to continue.&lt;/p&gt;

&lt;p&gt;Restart Apache to implement the changes. Make sure to restart now even if you have restarted earlier in this tutorial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will download and set up WordPress itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — Downloading WordPress
&lt;/h2&gt;

&lt;p&gt;Now that our server software is configured, we can download and set up WordPress. For security reasons in particular, it is always recommended to get the latest version of WordPress from their site.&lt;/p&gt;

&lt;p&gt;Change into a writable directory (we recommend a temporary one like &lt;code&gt;/tmp&lt;/code&gt;) and download the compressed release.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /tmp
curl -O https://wordpress.org/latest.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Extract the compressed file to create the WordPress directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar xzvf latest.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be moving these files into our document root momentarily. Before we do, we can add a dummy &lt;code&gt;.htaccess&lt;/code&gt; file so that this will be available for WordPress to use later.&lt;/p&gt;

&lt;p&gt;Create the file by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch /tmp/wordpress/.htaccess
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ll also copy over the sample configuration file to the filename that WordPress reads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also create the &lt;code&gt;upgrade&lt;/code&gt; directory, so that WordPress won’t run into permissions issues when trying to do this on its own following an update to its software:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir /tmp/wordpress/wp-content/upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can copy the entire contents of the directory into our document root. We are using a dot at the end of our source directory to indicate that everything within the directory should be copied, including hidden files (like the &lt;code&gt;.htaccess&lt;/code&gt; file we created):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp -a /tmp/wordpress/. /var/www/wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure that you replace the &lt;code&gt;/var/www/wordpress&lt;/code&gt; directory with the directory you have set up on your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5 — Configuring the WordPress Directory
&lt;/h2&gt;

&lt;p&gt;Before we do the web-based WordPress setup, we need to adjust some items in our WordPress directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adjusting the Ownership and Permissions
&lt;/h3&gt;

&lt;p&gt;An important step that we need to accomplish is setting up reasonable file permissions and ownership.&lt;/p&gt;

&lt;p&gt;We’ll start by giving ownership of all the files to the &lt;strong&gt;www-data&lt;/strong&gt; user and group. This is the user that the Apache web server runs as, and Apache will need to be able to read and write WordPress files in order to serve the website and perform automatic updates.&lt;/p&gt;

&lt;p&gt;Update the ownership with the &lt;code&gt;chown&lt;/code&gt; command which allows you to modify file ownership. Be sure to point to your server’s relevant directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data /var/www/wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we’ll run two &lt;code&gt;find&lt;/code&gt; commands to set the correct permissions on the WordPress directories and files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo find /var/www/wordpress/ -type d -exec chmod 750 {} \;
sudo find /var/www/wordpress/ -type f -exec chmod 640 {} \;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These permissions should get you working effectively with WordPress, but note that some plugins and procedures may require additional tweaks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up the WordPress Configuration File
&lt;/h3&gt;

&lt;p&gt;Now, we need to make some changes to the main WordPress configuration file.&lt;/p&gt;

&lt;p&gt;When we open the file, our first task will be to adjust some secret keys to provide a level of security for our installation. WordPress provides a secure generator for these values so that you do not have to try to come up with good values on your own. These are only used internally, so it won’t hurt usability to have complex, secure values here.&lt;/p&gt;

&lt;p&gt;To grab secure values from the WordPress secret key generator, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -s https://api.wordpress.org/secret-key/1.1/salt/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will get back unique values that resemble output similar to the block below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning!&lt;/strong&gt; It is important that you request unique values each time. Do &lt;strong&gt;NOT&lt;/strong&gt; copy the values below!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;define('AUTH_KEY',         '1jl/vqfs&amp;lt;XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^&amp;lt;+c9.k&amp;lt;J@4H');
define('SECURE_AUTH_KEY',  'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3');
define('LOGGED_IN_KEY',    'W(50,{W^,OPB%PB&amp;lt;JF DO NOT COPY THESE VALUES 2;y&amp;amp;,2m%3]R6DUth[;88');
define('NONCE_KEY',        'll,4UC)7ua+8&amp;lt;!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g');
define('AUTH_SALT',        'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES  07VC*Lj*lD&amp;amp;?3w!BT#-');
define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY');
define('LOGGED_IN_SALT',   'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|');
define('NONCE_SALT',       'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&amp;amp;xqHN&amp;amp;%');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are configuration lines that we can paste directly in our configuration file to set secure keys. Copy the output you received now.&lt;/p&gt;

&lt;p&gt;Next, open the WordPress configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /var/www/wordpress/wp-config.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the section that contains the example values for those settings.&lt;br&gt;
&lt;/p&gt;

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

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

. . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete those lines and paste in the values you copied from the command line:&lt;br&gt;
&lt;/p&gt;

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

define('AUTH_KEY',         'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_KEY',  'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_KEY',    'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_KEY',        'VALUES COPIED FROM THE COMMAND LINE');
define('AUTH_SALT',        'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_SALT', 'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_SALT',   'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_SALT',       'VALUES COPIED FROM THE COMMAND LINE');

. . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we are going to modify some of the database connection settings at the beginning of the file. You need to adjust the database name, the database user, and the associated password that you configured within MySQL.&lt;/p&gt;

&lt;p&gt;The other change we need to make is to set the method that WordPress should use to write to the filesystem. Since we’ve given the web server permission to write where it needs to, we can explicitly set the filesystem method to "direct". Failure to set this with our current settings would result in WordPress prompting for FTP credentials when we perform some actions.&lt;/p&gt;

&lt;p&gt;This setting can be added below the database connection settings, or anywhere else in the file:&lt;br&gt;
&lt;/p&gt;

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

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** MySQL database username */
define( 'DB_USER', 'wordpressuser' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );


. . .

define('FS_METHOD', 'direct');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and close the file when you are finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6 — Completing the Installation Through the Web Interface
&lt;/h2&gt;

&lt;p&gt;Now that the server configuration is complete, we can complete the installation through the web interface.&lt;/p&gt;

&lt;p&gt;In your web browser, navigate to your server’s domain name or public IP address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://server_domain_or_IP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select the language you would like to use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Flanguage_selection.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Flanguage_selection.png" alt="WordPress language selection"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you will come to the main setup page.&lt;/p&gt;

&lt;p&gt;Select a name for your WordPress site and choose a username. It is recommended to choose something unique and avoid common usernames like “admin” for security purposes. A strong password is generated automatically. Save this password or select an alternative strong password.&lt;/p&gt;

&lt;p&gt;Enter your email address and select whether you want to discourage search engines from indexing your site:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Fsetup_installation.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Fsetup_installation.png" alt="WordPress setup installation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you click ahead, you will be taken to a page that prompts you to log in:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Flogin_prompt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Flogin_prompt.png" alt="WordPress login prompt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you log in, you will be taken to the WordPress administration dashboard:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Fadmin_screen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fwordpress_lamp_1604%2Fadmin_screen.png" alt="WordPress login prompt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, you can begin to design your WordPress website! If this is your first time using WordPress, explore the interface a bit to get acquainted with your new CMS.&lt;/p&gt;

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

&lt;p&gt;Congratulations, WordPress is now installed and is ready to be used! &lt;/p&gt;

&lt;p&gt;At this point you may want to start doing the following: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose your permalinks setting for WordPress posts, which can be found in &lt;code&gt;Settings &amp;gt; Permalinks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select a new theme in &lt;code&gt;Appearance &amp;gt; Themes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install new plugins to increase your site’s functionality under &lt;code&gt;Plugins &amp;gt;  Add New&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;If you are going to collaborate with others, you may also wish to add additional users at this time under &lt;code&gt;Users &amp;gt; Add New&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find additional resources for alternate ways to install WordPress, learn how to install WordPress on different server distributions, automate your WordPress installations, and scale your WordPress sites by checking out the &lt;a href="https://www.digitalocean.com/community/tags/wordpress" rel="noopener noreferrer"&gt;WordPress Community tag on DigitalOcean&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>linux</category>
      <category>tutorial</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How To Install Git from Source on Ubuntu 20.04</title>
      <dc:creator>Lisa Tagliaferri</dc:creator>
      <pubDate>Wed, 01 Jul 2020 20:53:39 +0000</pubDate>
      <link>https://dev.to/digitalocean/how-to-install-git-from-source-on-ubuntu-20-04-51fi</link>
      <guid>https://dev.to/digitalocean/how-to-install-git-from-source-on-ubuntu-20-04-51fi</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Version control systems like Git are essential to modern software development best practices. Versioning allows you to keep track of your software at the source level. You can track changes, revert to previous stages, and branch to create alternate versions of files and directories.&lt;/p&gt;

&lt;p&gt;In this guide, we will go through how to install and configure Git on an Ubuntu 20.04 server via source. This provides you with a more flexibility, but takes longer than installing through your package manager (also note that Git will not be maintained through your package manager). Downloading the latest release will also provide you with access to the most recent functionality, and give you greater control over options and customizations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;This guide was tested on an Ubuntu 20.04 server with a non-root superuser account. &lt;/p&gt;

&lt;p&gt;If you need to set this up, you can follow the &lt;a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04"&gt;Initial Server Setup Guide for Ubuntu 20.04&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — Confirm Git Preinstallation
&lt;/h2&gt;

&lt;p&gt;Verify the version of Git currently installed on the server:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If Git is installed, you’ll receive output similar to the following:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Whether or not you have Git installed already, it is worth checking to make sure that you install a more recent version during this process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Update and Install Dependencies
&lt;/h2&gt;

&lt;p&gt;Before you begin, you need to install the software that Git depends on. This is all available in the default repositories, so we can update our local package index and then install the relevant packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press &lt;code&gt;y&lt;/code&gt; to confirm if prompted. Necessary dependencies should now be installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — Install Tarball
&lt;/h2&gt;

&lt;p&gt;After you have installed the necessary dependencies, create a temporary directory and move into it. This is where we will download our Git tarball.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir tmp
cd /tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the &lt;a href="https://git-scm.com/"&gt;Git project website&lt;/a&gt;, we can navigate to the tarball list available at &lt;a href="https://mirrors.edge.kernel.org/pub/software/scm/git/"&gt;https://mirrors.edge.kernel.org/pub/software/scm/git/&lt;/a&gt; and download the version you would like. At the time of writing, the most recent version is 2.26.2, so we will download that for demonstration purposes. We’ll use curl and output the file we download to &lt;code&gt;git.tar.gz&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -o git.tar.gz https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.26.2.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next step, we'll work with this tarball.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — Unpack Compressed File and Install the Package
&lt;/h2&gt;

&lt;p&gt;Unpack the compressed tarball file:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Next, move into the new Git directory:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Now, you can make the package and install it by typing these two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make prefix=/usr/local all
sudo make prefix=/usr/local install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, Git is installed and you can refresh your environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5 — Verify New Version of Git
&lt;/h2&gt;

&lt;p&gt;Now, replace the shell process so that the version of Git we just installed will be used:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;With this complete, you can be sure that your install was successful by checking the version.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You should receive output similar to the following, with a more recent number than the preinstalled version of Git.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;With Git successfully installed, you can now complete your setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6 — Set Up Git
&lt;/h2&gt;

&lt;p&gt;After you are satisfied with your Git version, you should configure Git so that the generated commit messages you make will contain your correct information and support you as you build your software project.&lt;/p&gt;

&lt;p&gt;Configuration can be achieved by using the &lt;code&gt;git config&lt;/code&gt; command. Specifically, we need to provide our name and email address because Git embeds this information into each commit we do. We can go ahead and add this information by typing:&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.name "Your Name"
git config --global user.email "youremail@domain.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can display all of the configuration items that have been set by typing:&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 --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll get output to demonstrate that your name and email are set up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.name=Your Name
user.email=youremail@domain.com
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The information you enter is stored in your Git configuration file, which you can optionally edit by hand with a text editor of your choice like this (we’ll use nano):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file will be similar to the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
  name = Your Name
  email = youremail@domain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press &lt;code&gt;CTRL&lt;/code&gt; and &lt;code&gt;X&lt;/code&gt;, then &lt;code&gt;Y&lt;/code&gt; then &lt;code&gt;ENTER&lt;/code&gt; to exit the text editor. &lt;/p&gt;

&lt;p&gt;There are many other options that you can set, but these are the two essential ones needed. If you skip this step, you’ll likely see warnings when you commit to Git. This makes more work for you because you will then have to revise the commits you have done with the corrected information.&lt;/p&gt;

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

&lt;p&gt;You should now have the most recent available version of Git installed and ready to use on your system. &lt;/p&gt;

&lt;p&gt;To learn more about how to use Git, check out these articles and series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/articles/how-to-use-git-effectively"&gt;How To Use Git Effectively&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/articles/how-to-use-git-branches"&gt;How To Use Git Branches&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source"&gt;An Introduction to Open Source&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>linux</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The DigitalOcean Community Weekly: DNS, Docker, K8s Canary Deployments, &amp; More</title>
      <dc:creator>Lisa Tagliaferri</dc:creator>
      <pubDate>Fri, 28 Jun 2019 14:53:42 +0000</pubDate>
      <link>https://dev.to/digitalocean/the-digitalocean-community-weekly-dns-docker-k8s-canary-deployments-more-55e</link>
      <guid>https://dev.to/digitalocean/the-digitalocean-community-weekly-dns-docker-k8s-canary-deployments-more-55e</guid>
      <description>&lt;p&gt;Welcome to the second edition of &lt;strong&gt;&lt;a href="https://dev.to/t/docomweekly"&gt;The DOCOM Weekly&lt;/a&gt;&lt;/strong&gt;, your weekly digest featuring some of the best content published in and around the &lt;a href="https://digitalocean.com/community" rel="noopener noreferrer"&gt;DigitalOcean Community&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m Lisa, a member on the Developer Education team, and I’m excited about sharing knowledge throughout the developer community. Today’s roundup includes DNS management, speeding up Docker workflows, canary deployments with Istio and Kubernetes, and more!&lt;/p&gt;

&lt;p&gt;We’ll begin with our featured posts from the past week on the DigitalOcean Community:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-and-manage-your-dns-using-dnscontrol-on-ubuntu-18-04" rel="noopener noreferrer"&gt;How To Deploy and Manage Your DNS using DNSControl on Ubuntu 18.04&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.jamieweb.net/" rel="noopener noreferrer"&gt;Jamie Scaife&lt;/a&gt; with editor &lt;a href="https://dev.to/kathancox"&gt;Kathryn Hancox&lt;/a&gt; walk you through using DNSControl to eliminate many of the pain points of manual DNS management. This tutorial was published through our &lt;a href="https://www.digitalocean.com/write-for-donations/" rel="noopener noreferrer"&gt;Write for DOnations&lt;/a&gt; program, with funding going to the &lt;a href="https://www.brightfunds.org/organizations/electronic-frontier-foundation-inc" rel="noopener noreferrer"&gt;Electronic Frontier Foundation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-use-a-remote-docker-server-to-speed-up-your-workflow" rel="noopener noreferrer"&gt;How To Use a Remote Docker Server to Speed Up Your Workflow&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This tutorial, written by &lt;a href="https://dev.to/kamaln7"&gt;Kamal Nasser&lt;/a&gt; and edited by &lt;a href="https://dev.to/bphogan"&gt;Brian P. Hogan&lt;/a&gt;, helps you get your work done faster by demonstrating how to offload Docker tasks to a remote server so your local machine doesn’t have to do the heavy lifting.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-do-canary-deployments-with-istio-and-kubernetes" rel="noopener noreferrer"&gt;How To Do Canary Deployments With Istio and Kubernetes&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fdocker_node_image%2Fsharks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.digitalocean.com%2Farticles%2Fdocker_node_image%2Fsharks.png" alt="Shark Info Page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you would like to build out canary deployments with Istio and Kubernetes, you can learn how to do so through reading this tutorial by &lt;a href="https://dev.to/katjuell"&gt;Kathleen Juell&lt;/a&gt;. This article will guide you through creating a canary deployment of a demo Node.js application, providing you with a basis for your own work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Featured Q&amp;amp;A
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://www.digitalocean.com/community/questions" rel="noopener noreferrer"&gt;DigitalOcean Community Questions&lt;/a&gt; section of our Community site is a space for you to ask a development question or provide an answer for others. Here are some questions on the minds of members of the community from the past week.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/questions/how-can-one-droplet-access-another-and-write-files" rel="noopener noreferrer"&gt;How can one Droplet access another and write files?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/questions/another-domain-is-pointing-to-my-ip-address-and-mirroring-my-website" rel="noopener noreferrer"&gt;Another domain is pointing to my IP address and mirroring my website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you would like to learn more around cloud infrastructure or software development, or if you need help with troubleshooting, &lt;a href="https://www.digitalocean.com/community/questions/new" rel="noopener noreferrer"&gt;ask a question&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  DigitalOcean on DEV
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/monty5811"&gt;monty5811&lt;/a&gt; shared a quick tutorial on how to create expiring links to an object on DigitalOcean Spaces with Django.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/monty5811" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F40318%2Ff4ec6615-77c6-4989-b4b9-6ff05526b778.jpg" alt="monty5811"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/monty5811/expiring-signed-links-with-digital-ocean-spaces-2hck" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Expiring (Signed) Links with Digital Ocean Spaces&lt;/h2&gt;
      &lt;h3&gt;monty5811 ・ Jun 12 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#django&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#digitalocean&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#python&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://dev.to/davidemily"&gt;David Emily&lt;/a&gt; provides a gentle introduction to remote servers with DigitalOcean Droplets in this server setup guide.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/davidemily" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F172680%2F1ded69fb-7008-4b98-ba76-692d3a215eda.jpeg" alt="davidemily"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/davidemily/removing-root-login-and-other-first-steps-ubuntu-54le" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Removing Root Login And Other First Steps Ubuntu&lt;/h2&gt;
      &lt;h3&gt;David Emily ・ Jun 21 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#ubuntu&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#linux&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  DigitalOcean on the Web
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/teyckmans" rel="noopener noreferrer"&gt;Tom Eyckmans&lt;/a&gt; details how to set up a KubeRig environment using DigitalOcean’s Kubernetes service in this write-up, &lt;strong&gt;&lt;a href="https://rigel.dev/kuberig-doks/" rel="noopener noreferrer"&gt;KubeRig &amp;amp; DigitalOcean Kubernetes (DOKS)&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/AdamAGShamblin" rel="noopener noreferrer"&gt;Adam A. G. Shamblin&lt;/a&gt; describes how he installed Kong with Ingress on DigitalOcean Kubernetes in order to evaluate API gateway platforms in his guide &lt;strong&gt;&lt;a href="https://letters.vexingworkshop.com/installing-kong-w-ingress-on-kubernetes-in-digitalocean.html" rel="noopener noreferrer"&gt;Installing Kong w/ Ingress on Kubernetes in DigitalOcean&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/elliot_f"&gt;Elliot Forbes&lt;/a&gt; created a video walkthrough of his DigitalOcean tutorial, &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-resilient-go-app-digitalocean-kubernetes" rel="noopener noreferrer"&gt;How to Deploy a Resilient Go Application to Kubernetes on DigitalOcean&lt;/a&gt;.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  More to Check Out in the Developer Community
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.anxietytech.com/" rel="noopener noreferrer"&gt;Anxiety Tech 2019&lt;/a&gt; is a mental health conference for the tech industry taking place in New York City in August. Join DigitalOcean’s own &lt;a href="https://dev.to/fharper"&gt;Frédéric Harper&lt;/a&gt; to learn more about the intersections of mental health and tech and how to advocate for more mental health awareness at work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FD-BYNzaVAAAf_dD.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FD-BYNzaVAAAf_dD.jpg" alt="Anxiety Tech Panel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend developer &lt;a href="https://dev.to/ananyaneogi"&gt;Ananya Neogi&lt;/a&gt; recently highlighted some of the amazing things that pure HTML can do. Learn more about the unsung markup language by following along:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/ananyaneogi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F106991%2Fb487674a-45f7-4116-b695-a2607893e0ac.jpg" alt="ananyaneogi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/ananyaneogi/html-can-do-that-c0n" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;HTML can do that?&lt;/h2&gt;
      &lt;h3&gt;Ananya Neogi ・ Jun 25 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#html&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;p&gt;&lt;em&gt;Happy hacking, and see you all next week!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>digitalocean</category>
      <category>news</category>
      <category>docomweekly</category>
      <category>docom</category>
    </item>
    <item>
      <title>How To Use Git: A Reference Guide</title>
      <dc:creator>Lisa Tagliaferri</dc:creator>
      <pubDate>Mon, 07 Jan 2019 20:11:19 +0000</pubDate>
      <link>https://dev.to/digitalocean/how-to-use-git-a-reference-guide-6b6</link>
      <guid>https://dev.to/digitalocean/how-to-use-git-a-reference-guide-6b6</guid>
      <description>&lt;h2&gt;
  
  
  Git Cheat Sheet
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Teams of developers and open-source software maintainers typically manage their projects through Git, a distributed version control system that supports collaboration.&lt;/p&gt;

&lt;p&gt;This cheat sheet-style guide provides a quick reference to commands that are useful for working and collaborating in a Git repository. To install and configure Git, be sure to read “&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-contribute-to-open-source-getting-started-with-git" rel="noopener noreferrer"&gt;How To Contribute to Open Source: Getting Started with Git&lt;/a&gt;.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Use This Guide:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This guide is in cheat sheet format with self-contained command-line snippets.&lt;/li&gt;
&lt;li&gt;Jump to any section that is relevant to the task you are trying to complete.&lt;/li&gt;
&lt;li&gt;When you see &lt;code&gt;highlighted text&lt;/code&gt; in this guide’s commands, keep in mind that this text should refer to the commits and files in &lt;em&gt;your own&lt;/em&gt; repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Set Up and Initialization
&lt;/h2&gt;

&lt;p&gt;Check your Git version with the following command, which will also confirm that Git is installed.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You can initialize your current working directory as a Git repository with &lt;code&gt;init&lt;/code&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 init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To copy an existing Git repository hosted remotely, you’ll use &lt;code&gt;git clone&lt;/code&gt; with the repo’s URL or server location (in the latter case you will use &lt;code&gt;ssh&lt;/code&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 clone https://www.github.com/username/repo-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show your current Git directory’s remote 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 remote
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a more verbose output, use the &lt;code&gt;-v&lt;/code&gt; flag.&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;p&gt;Add the Git upstream, which can be a URL or can be hosted on a server (in the latter case, connect with &lt;code&gt;ssh&lt;/code&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 remote add upstream https://www.github.com/username/repo-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Staging
&lt;/h2&gt;

&lt;p&gt;When you’ve modified a file and have marked it to go in your next commit, it is considered to be a staged file.&lt;/p&gt;

&lt;p&gt;Check the status of your Git repository, including files added that are not staged, and files that are staged.&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;p&gt;To stage modified files, use the &lt;code&gt;add&lt;/code&gt; command, which you can run multiple times before a commit. If you make subsequent changes that you want included in the next commit, you must run &lt;code&gt;add&lt;/code&gt; again.&lt;/p&gt;

&lt;p&gt;You can specify the specific file with &lt;code&gt;add&lt;/code&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 my_script.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;.&lt;/code&gt; you can add all files in the current directory including files that begin with a &lt;code&gt;.&lt;/code&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 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can remove a file from staging while retaining changes within your working directory with &lt;code&gt;reset&lt;/code&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 reset my_script.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Committing
&lt;/h2&gt;

&lt;p&gt;Once you have staged your updates, you are ready to commit them, which will record changes you have made to the repository.&lt;/p&gt;

&lt;p&gt;To commit staged files, you’ll run the &lt;code&gt;commit&lt;/code&gt; command with your meaningful commit message so that you can track 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 commit -m "Commit message"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can condense staging all tracked files with committing them in one step.&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 -am "Commit message"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to modify your commit message, you can do so with the &lt;code&gt;--amend&lt;/code&gt; flag.&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 -m "New commit message"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Branches
&lt;/h2&gt;

&lt;p&gt;A branch in Git is a movable pointer to one of the commits in the repository, it allows you to isolate work and manage feature development and integrations. You can learn more about branches by reading the &lt;a href="https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is" rel="noopener noreferrer"&gt;Git documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;List all current branches with the &lt;code&gt;branch&lt;/code&gt; command. An asterisk (&lt;code&gt;*&lt;/code&gt;) will appear next to your currently active branch.&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;p&gt;Create a new branch. You will remain on your currently active branch until you switch to the new one.&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 new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch to any existing branch and check it out into your current working directory.&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 another-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can consolidate the creation and checkout of a new branch by using the &lt;code&gt;-b&lt;/code&gt; flag.&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 new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rename your branch name.&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 -m current-branch-name new-branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Merge the specified branch’s history into the one you’re currently working in.&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;p&gt;Abort the merge, in case there are conflicts.&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;p&gt;You can also select a particular commit to merge with &lt;code&gt;cherry-pick&lt;/code&gt; with the string that references the specific 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 cherry-pick f7649d0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you have merged a branch and no longer need the branch, you can delete 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 branch -d branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have not merged a branch to master, but are sure you want to delete it, you can &lt;strong&gt;force&lt;/strong&gt; delete a branch.&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;
  
  
  Collaborate and Update
&lt;/h2&gt;

&lt;p&gt;To download changes from another repository, such as the remote upstream, you’ll use &lt;code&gt;fetch&lt;/code&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 fetch upstream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Merge the fetched 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 merge upstream/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Push or transmit your local branch commits to the remote repository branch.&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 origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetch and merge any commits from the tracking remote branch.&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;
  
  
  Inspecting
&lt;/h2&gt;

&lt;p&gt;Display the commit history for the currently active branch.&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;p&gt;Show the commits that changed a particular file. This follows the file regardless of file renaming.&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 --follow my_script.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show the commits that are on one branch and not on the other. This will show commits on &lt;code&gt;a-branch&lt;/code&gt; that are not on &lt;code&gt;b-branch&lt;/code&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 log a-branch..b-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at reference logs (&lt;code&gt;reflog&lt;/code&gt;) to see when the tips of branches and other references were last updated within the 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 reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show any object in Git via its commit string or hash in a more human-readable format.&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 de754f5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Show Changes
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;git diff&lt;/code&gt; command shows changes between commits, branches, and more. You can read more fully about it through the &lt;a href="https://git-scm.com/docs/git-diff" rel="noopener noreferrer"&gt;Git documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Compare modified files that are on 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 diff --staged
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display the diff of what is in &lt;code&gt;a-branch&lt;/code&gt; but is not in &lt;code&gt;b-branch&lt;/code&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 diff a-branch..b-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show the diff between two specific 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 diff 61ce3e6..e221d9c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Stashing
&lt;/h2&gt;

&lt;p&gt;Sometimes you’ll find that you made changes to some code, but before you finish you have to begin working on something else. You’re not quite ready to commit the changes you have made so far, but you don’t want to lose your work. The &lt;code&gt;git stash&lt;/code&gt; command will allow you to save your local modifications and revert back to the working directory that is in line with the most recent &lt;code&gt;HEAD&lt;/code&gt; commit.&lt;/p&gt;

&lt;p&gt;Stash your current work.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;See what you currently have stashed.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Your stashes will be named &lt;code&gt;stash@{0}&lt;/code&gt;, &lt;code&gt;stash@{1}&lt;/code&gt;, and so on.&lt;/p&gt;

&lt;p&gt;Show information about a particular stash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash show stash@{0}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To bring the files in a current stash out of the stash while still retaining the stash, use &lt;code&gt;apply&lt;/code&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 stash apply stash@{0}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to bring files out of a stash, and no longer need the stash, use &lt;code&gt;pop&lt;/code&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 stash pop stash@{0}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you no longer need the files saved in a particular stash, you can &lt;code&gt;drop&lt;/code&gt; the stash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash drop stash@{0}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have multiple stashes saved and no longer need to use any of them, you can use &lt;code&gt;clear&lt;/code&gt; to remove them.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ignoring Files
&lt;/h2&gt;

&lt;p&gt;If you want to keep files in your local Git directory, but do not want to commit them to the project, you can add these files to your &lt;code&gt;.gitignore&lt;/code&gt; file so that they do not cause conflicts.&lt;/p&gt;

&lt;p&gt;Use a text editor such as nano to add files to the &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To see examples of &lt;code&gt;.gitignore&lt;/code&gt; files, you can look at GitHub’s &lt;a href="https://github.com/github/gitignore" rel="noopener noreferrer"&gt;&lt;code&gt;.gitignore&lt;/code&gt; template repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rebasing
&lt;/h2&gt;

&lt;p&gt;A rebase allows us to move branches around by changing the commit that they are based on. With rebasing, you can squash or reword commits.&lt;/p&gt;

&lt;p&gt;You can start a rebase by either calling the number of commits you have made that you want to rebase (&lt;code&gt;5&lt;/code&gt; in the case 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 rebase -i HEAD~5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you can rebase based on a particular commit string or hash.&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 -i 074a4e5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have squashed or reworded commits, you can complete the rebase of your branch on top of the latest version of the project’s upstream code.&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 upstream/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To learn more about rebasing and updating, you can read &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request" rel="noopener noreferrer"&gt;How To Rebase and Update a Pull Request&lt;/a&gt;, which is also applicable to any type of commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resetting
&lt;/h2&gt;

&lt;p&gt;Sometimes, including after a rebase, you need to reset your working tree. You can reset to a particular commit, and &lt;strong&gt;delete all changes&lt;/strong&gt; , with 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 reset --hard 1fc6665
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To force push your last known non-conflicting commit to the origin repository, you’ll need to use &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: Force pushing to master is often frowned upon unless there is a really important reason for doing it. Use sparingly when working on your own repositories, and work to avoid this when you’re collaborating.&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 --force origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove local untracked files and subdirectories from the Git directory for a clean working branch, you can use &lt;code&gt;git clean&lt;/code&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 clean -f -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to modify your local repository so that it looks like the current upstream master (that is, there are too many conflicts), you can perform a hard reset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Performing this command will make your local repository look exactly like the upstream. Any commits you have made but that were not pulled into the upstream &lt;strong&gt;will be destroyed&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 reset --hard upstream/master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;This guide covers some of the more common Git commands you may use when managing repositories and collaborating on software.&lt;/p&gt;

&lt;p&gt;You can learn more about open-source software and collaboration in our &lt;a href="https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source" rel="noopener noreferrer"&gt;Introduction to Open Source tutorial series&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-contribute-to-open-source-getting-started-with-git" rel="noopener noreferrer"&gt;How To Contribute to Open Source: Getting Started with Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github" rel="noopener noreferrer"&gt;How To Create a Pull Request on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request" rel="noopener noreferrer"&gt;How To Rebase and Update a Pull Request&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-maintain-open-source-software-projects" rel="noopener noreferrer"&gt;How To Maintain Open-Source Software Projects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many more commands and variations that you may find useful as part of your work with Git. To learn more about all of your available options, you can run:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To receive useful information. You can also read more about Git and look at Git’s documentation from the &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;official Git website&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff9dopc8jjbnew6l2xc2j.png" alt="CC 4.0 License" width="88" height="31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener noreferrer"&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>guide</category>
    </item>
  </channel>
</rss>
