<?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>Forem: Hassam Ul Haq</title>
    <description>The latest articles on Forem by Hassam Ul Haq (@hassamulhaq).</description>
    <link>https://forem.com/hassamulhaq</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%2F679578%2F66eddf3b-d1a5-42e3-af45-a9998ee84168.jpeg</url>
      <title>Forem: Hassam Ul Haq</title>
      <link>https://forem.com/hassamulhaq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hassamulhaq"/>
    <language>en</language>
    <item>
      <title>Git error: src refspec master does not match any</title>
      <dc:creator>Hassam Ul Haq</dc:creator>
      <pubDate>Fri, 29 Jul 2022 10:42:32 +0000</pubDate>
      <link>https://forem.com/hassamulhaq/git-error-src-refspec-master-does-not-match-any-od2</link>
      <guid>https://forem.com/hassamulhaq/git-error-src-refspec-master-does-not-match-any-od2</guid>
      <description>&lt;p&gt;There are a few reasons Git throws an error: src refspec master does not match any. Let’s figure it out. This is a detailed article and I fully tried to cover all errors that I faced. And step by step I cover the fixing of src refspec master does not match any…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error type:&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 push -u origin master
error: src refspec master does not match any.
error: Please make sure you have the correct access rights and the repository exists.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1: Check credentials using Credential Manager
&lt;/h2&gt;

&lt;p&gt;Sometimes we use &lt;strong&gt;one or more github accounts&lt;/strong&gt; in same OS so let’s check it. Go to windows search and type “Credential Manager”. Open Windows Credentials and check Github account details in Generic Credentials.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6oHduoou--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ucbfa80sjc6ev6csy3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6oHduoou--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ucbfa80sjc6ev6csy3n.png" alt="Image description" width="756" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Here we can see the username of the Github account. if the username is correct then proceed to the next step. Or if you have any doubt regarding the password then click Edit the and your Github account password and save it. Note: Restart your system (optional)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 Check Git remote origin
&lt;/h2&gt;



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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-v flag&lt;/code&gt; lets us see the URLs to which our repository is pointing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;origin  https://github.com/devhassam/ticket-reservation.git (fetch)
origin  https://github.com/devhassam/ticket-reservation.git (push)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If no line appears after running&lt;/strong&gt; &lt;code&gt;git remote -v&lt;/code&gt; then you first need to register git repo. Or if details are shown like in the above image then skip the next 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 remote add origin /path/to/origin.git

e.g
git remote add origin https://github.com/devhassam/ticket-reservation.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pushing the changes to the master or remote branch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



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

git commit -m "First commit"
git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;If the error is still there then just add&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;-u flag&lt;/code&gt; with git push origin master&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 origin /path/to/origin.git
git add .

git commit -m "First commit"
git push origin -u master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding &lt;strong&gt;-u flag&lt;/strong&gt; a Github Authentication POP-UP would appear. Add Github username and password, or simply login using Token. If you choose Token then the pop-up will show a 6-digit code with github link. Copy the code and open the link where you need to add copied code and hit Authenticate.&lt;/p&gt;

&lt;p&gt;Thank you! And I hope this article is helpful.&lt;br&gt;
&lt;code&gt;https://hassam.me&lt;/code&gt;&lt;/p&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Display "FREE" if the price is zero ($0.00) or not set in Woocommerce?</title>
      <dc:creator>Hassam Ul Haq</dc:creator>
      <pubDate>Sat, 07 Aug 2021 19:53:02 +0000</pubDate>
      <link>https://forem.com/hassamulhaq/display-free-if-the-price-is-zero-0-00-or-not-set-in-woocommerce-437e</link>
      <guid>https://forem.com/hassamulhaq/display-free-if-the-price-is-zero-0-00-or-not-set-in-woocommerce-437e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9dvDXUT9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ni36dsu59pvrojca8cv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9dvDXUT9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ni36dsu59pvrojca8cv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I believe FREE looks good than $0.00&lt;/p&gt;

&lt;p&gt;Do you need to replace the default WooCommerce pricing label for a free product? Perhaps you offer some, if not all, of your products at no cost. Instead of showing the default WooCommerce price label of $0.00, you want to show custom text, such as the word &lt;strong&gt;“FREE”&lt;/strong&gt; or &lt;strong&gt;“Download Now”&lt;/strong&gt;.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
We really didn’t like showing a $ value of zero and so we replaced it with the text “FREE”. It turns out, that it’s really simple to do in WooCommerce.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
Do these changes in child-theme’s function.php&lt;br&gt;
If you have not a child theme then create a backup using Updraft Plugin and then follow the below steps. or you can contact your website theme developer for a Child-theme they can provide you a child-theme.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;pre&gt;
/**
* @snippet       Display FREE if Price Zero or Empty - WooCommerce Single Product
* @how-to        Display FREE if the price is zero
* @author        Hassam
* @testedwith    WooCommerce 3.8
* @follow        @devhassam
*/
  
add_filter( 'woocommerce_get_price_html', 'wooc_price_free_zero_empty', 9999, 2 );
   
function wooc_price_free_zero_empty( $price, $product ) {
    if ( '' === $product-&amp;gt;get_price() || 0 == $product-&amp;gt;get_price() ) {
        $price = '&lt;span&gt;FREE&lt;/span&gt;';
    }  
    return $price;
}
&lt;/pre&gt;

&lt;p&gt;Breaking it down, we’re just checking the price of the product to make sure that it is “empty” i.e. free, and then if it is, returning different label text which in the case above is the word “FREE”.&lt;/p&gt;

</description>
      <category>woocommerce</category>
      <category>displayfree</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
