<?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: Raj Hawaldar</title>
    <description>The latest articles on Forem by Raj Hawaldar (@rajhawaldar).</description>
    <link>https://forem.com/rajhawaldar</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%2F328648%2F2b8f16bb-9620-42c1-b9f3-5bbdc186db3c.jpeg</url>
      <title>Forem: Raj Hawaldar</title>
      <link>https://forem.com/rajhawaldar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rajhawaldar"/>
    <language>en</language>
    <item>
      <title>How to change author of the git commit</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Tue, 28 Feb 2023 08:13:37 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/how-to-chane-author-name-and-the-email-of-the-commit-4a9o</link>
      <guid>https://forem.com/rajhawaldar/how-to-chane-author-name-and-the-email-of-the-commit-4a9o</guid>
      <description>&lt;p&gt;First of all, we need to understand how the author name and email are set by the git version control.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Set the author name and email globally
&lt;/h4&gt;

&lt;p&gt;With the help of the following commands, we can set the committer's name and email globally.&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 "John Doe"
$ git config --global user.email "john@doe.org"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Set the author name and email for each repository
&lt;/h4&gt;

&lt;p&gt;We can set these details at repository level by omitting the &lt;em&gt;--global&lt;/em&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 config user.name "John Doe"
git config user.email "john@doe.org"

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

&lt;/div&gt;





&lt;h3&gt;
  
  
  Change the author while committing the code
&lt;/h3&gt;

&lt;p&gt;We can use the flag --author="Name &amp;lt;email&amp;gt;" with the git commit command. For example,&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 "New feature added" --author="John Doe &amp;lt;john@doe.org&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Change author of the last commit
&lt;/h3&gt;

&lt;p&gt;It's relatively easy to change the author of the last commit. Simply run the following command in the terminal, and you're done!&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 --author="author_name &amp;lt;email&amp;gt;" --no-edit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Don't forget to include email address in "&amp;lt;&amp;gt;"&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Change the author of the past commits (not the latest)
&lt;/h3&gt;

&lt;p&gt;This will be a little more challenging. Keep in mind that when we update the past commits , we actually rewrite the history of the git branch. We are going to use the &lt;em&gt;git rebase&lt;/em&gt; command, which can help us update almost everything in the past commits. &lt;/p&gt;

&lt;p&gt;First of all, we will identify the last "valid commit".&lt;/p&gt;

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

&lt;p&gt;We want to update the author of the last two commits. We must specify how far back we want to rewrite commits by telling the command which commit to rebase onto.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;Don’t include any commit which is already pushed to a remote repository. By supplying an alternative version of the same change, we will mislead other developers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In our case we want to update last two commits so we will pass  "HEAD~2" as commit hash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~2
&lt;span class="c"&gt;# We can also use the parrent id of the second commit (hash of the 3rd commit)&lt;/span&gt;
git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; 574b2bcfad6f7d347bc9a08953f037a1d8b79967
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git will now open the default editor with the similar details as shown below.&lt;/p&gt;

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

&lt;p&gt;Now we will mark the commits we want to modify by replacing the word "pick" with "edit".&lt;/p&gt;

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

&lt;p&gt;Git will walk us through each commit, and we can update the author details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Stopped at 3800a1cf1... make login responsive
You can amend the commit now, with

    git commit --amend

Once you are satisfied with your changes, run

    git rebase --continue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now use below commands to update the author and continue rebase till the last 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 --author="author_name &amp;lt;email&amp;gt;" --no-edit

git rebase --continue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once done, if we again run the &lt;em&gt;git log&lt;/em&gt; command, we will get the below output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;commit 5e679a69f5aed75d75a0a838167789d3d19431e5 (HEAD -&amp;gt; feature1)
Author: John Doe &amp;lt;john.doe@gmail.com&amp;gt;
Date:   Sun Feb 26 23:46:13 2023 +0530

    New feature added

commit 6293a1uk38fa37e827cc0f4355m77lck65aav965
Author: John Doe &amp;lt;john.doe@gmail.com&amp;gt;
Date:   Sun Feb 26 23:39:06 2023 +0530

    make login responsive

commit 574b2bcfad6f7d347bc9a08953f037a1d8b79967
Author: John Doe &amp;lt;john.doe@gmail.com&amp;gt;
Date:   Sun Feb 26 11:13:40 2023 +0530

    make dashboard screen

commit a0a838167789d3d194315e679a69f5aed75d75bb
Author: John Doe &amp;lt;john.doe@gmail.com&amp;gt;
Date:   Sun Feb 26 10:38:57 2023 +0530

    added border to images

commit 0a7634029ff6968a48781207acd61d74f45c35c6 (master)
Author: John Doe &amp;lt;john.doe@gmail.com&amp;gt;
Date:   Sun Feb 26 10:26:45 2023 +0530

    First commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important point is that the commit hashes of the last two commits have changed. If the branch is present remotely, we must force push it in order to push these changes to the git remote repository.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using the git filter-branch
&lt;/h4&gt;

&lt;p&gt;If we want to update the commits in bulk for the entire branch, we can use the following script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;FILTER_BRANCH_SQUELCH_WARNING&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="c"&gt;# This will suppress the warning shown by git&lt;/span&gt;

git filter-branch &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="nt"&gt;--env-filter&lt;/span&gt; &lt;span class="s1"&gt;'
    if test "$GIT_AUTHOR_EMAIL" = "richard.roe@gmail.com"
    then
        GIT_AUTHOR_NAME="John Doe"
        GIT_AUTHOR_EMAIL=john.doe@gmail.com
    fi
    if test "$GIT_COMMITTER_EMAIL" = "richard.roe@gmail.com"
    then
        GIT_COMMITTER_NAME="John Doe"
        GIT_COMMITTER_EMAIL=john.doe@gmail.com
    fi
'&lt;/span&gt; HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script mentioned above will change the author of every commit that meets the condition.&lt;/p&gt;

&lt;h5&gt;
  
  
  What is the difference between a committer and an author?
&lt;/h5&gt;

&lt;p&gt;The &lt;em&gt;"author"&lt;/em&gt; is the person who originally wrote the code, and the &lt;em&gt;"committer"&lt;/em&gt; is the person who committed the code on behalf of the original author. For instance, if a project maintainer receives a patch and applies it, the author of the patch still receives credit for the work.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;git-filter-branch&lt;/em&gt; is such a powerful command that it can easily corrupt repositories or leave you with a mess worse than you began with. Avoid using it with the public or shared repositories.&lt;/p&gt;

&lt;p&gt;Thanks for reading, I hope this is helpful.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>cli</category>
      <category>database</category>
      <category>learning</category>
    </item>
    <item>
      <title>Why chrome shows so many processes in Task Manager for only one tab?</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Sun, 09 Aug 2020 05:24:19 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/why-chrome-shows-so-many-process-in-task-manager-for-only-one-tab-1j56</link>
      <guid>https://forem.com/rajhawaldar/why-chrome-shows-so-many-process-in-task-manager-for-only-one-tab-1j56</guid>
      <description>&lt;p&gt;Chrome applies the same kind of &lt;strong&gt;process isolation&lt;/strong&gt; which we found in &lt;strong&gt;Operating System&lt;/strong&gt;. Chrome by default launches each website you open in its own process. &lt;strong&gt;It keeps web apps and plugins in separate processes from the browser itself.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Browsers that put everything in one process face real challenges. If one web app causes a crash in the rendering engine, it will take the rest of the browser with it, including any other web apps that are open. Chrome avoids this by isolating each plugin and tab in separate processes.&lt;/p&gt;

&lt;p&gt;Interestingly, Google Chrome has its own &lt;strong&gt;Task Manager&lt;/strong&gt; which you can get to by right clicking on the browser's title bar(Or &lt;strong&gt;Press shift+Esc&lt;/strong&gt;).  This Task Manager lets you track resource usage for each web app and plug-in, rather than for the entire browser. &lt;/p&gt;

&lt;p&gt;Read the &lt;a href="https://www.google.com/googlebooks/chrome/med_00.html" rel="noopener noreferrer"&gt;Chome Introduction Comic&lt;/a&gt; for more details!&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>let's understand git diff</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Sun, 26 Jul 2020 08:12:10 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/lets-try-to-understand-git-diff-56l6</link>
      <guid>https://forem.com/rajhawaldar/lets-try-to-understand-git-diff-56l6</guid>
      <description>&lt;p&gt;Have you ever used git diff command? git diff is &lt;em&gt;multi-use&lt;/em&gt; command which will help you to find out the &lt;em&gt;difference between git data sources&lt;/em&gt;. These data sources can be &lt;em&gt;commits, branches, files&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;First understand some key-terms,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Working directory:&lt;/strong&gt; Git working directory implies the area where we do all our changes. Git continously monitor this area for changes. If you execute command 'git status' you can see the changes present in working directory. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staging area(also known as git index):&lt;/strong&gt; staging area contains all the changes which are ready for the commit. You can add/remove files from staging area using command &lt;strong&gt;&lt;em&gt;git add&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;git rm&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HEAD:&lt;/strong&gt; It is pointer which points to the &lt;strong&gt;&lt;em&gt;last commit&lt;/em&gt;&lt;/strong&gt; of your current branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Repository(.git):&lt;/strong&gt; Once we commit the changes from staging area usin &lt;strong&gt;&lt;em&gt;git commit&lt;/em&gt;&lt;/strong&gt; command they will get stored in your local repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tracked file:&lt;/strong&gt; It is any file which git tracks actively. For example:Files which are already commited or files present in staging area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;untracked file:&lt;/strong&gt; A newly created file which is not under git's version control.&lt;/p&gt;

&lt;p&gt;Now lets move to the &lt;strong&gt;&lt;em&gt;git diff&lt;/em&gt;&lt;/strong&gt; command,  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git diff:&lt;/strong&gt; It shows only those changes of &lt;strong&gt;&lt;em&gt;tracked files&lt;/em&gt;&lt;/strong&gt; which are present in &lt;strong&gt;&lt;em&gt;working directory&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git diff --cached:&lt;/strong&gt; It shows only those changes of &lt;strong&gt;&lt;em&gt;tracked files&lt;/em&gt;&lt;/strong&gt; which are present in &lt;strong&gt;&lt;em&gt;staging area&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git diff HEAD:&lt;/strong&gt; It shows all changes of tracked files which are present in &lt;strong&gt;&lt;em&gt;working directory&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;staging area&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git diff branch1..branch2:&lt;/strong&gt;  Git will compare the &lt;strong&gt;HEAD&lt;/strong&gt; of both branches and display a 'diff' recap that you can use to see modifications. It will show you all the commits that 'branch2” has that are not in 'branch1'.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpuv60ffrwb1a10qyitqq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpuv60ffrwb1a10qyitqq.jpg" alt="Alt Text" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git diff branch1...branch2:&lt;/strong&gt; Using 'git diff' with &lt;strong&gt;three dots&lt;/strong&gt; compares the &lt;strong&gt;HEAD&lt;/strong&gt; of the second branch with the common ancestor of the two branches. (It will show the changes made only in branch2).&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuqvdfmcglex4dxof6yby.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuqvdfmcglex4dxof6yby.jpg" alt="Alt Text" width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; If we provide file name at the end of all the above commands, the diff operation will be scoped to the specified file.&lt;/p&gt;

&lt;p&gt;I hope this is helpful. &lt;/p&gt;

</description>
      <category>git</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Updating to the latest version of Azure DevOps Server from TFS 2018</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Sun, 19 Jul 2020 05:29:25 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/updating-to-the-latest-version-of-azure-devops-server-from-tfs-2018-5a29</link>
      <guid>https://forem.com/rajhawaldar/updating-to-the-latest-version-of-azure-devops-server-from-tfs-2018-5a29</guid>
      <description>&lt;p&gt;With Azure DevOps 2019, Microsoft renamed &lt;strong&gt;&lt;em&gt;Visual Studio Team Foundation Server&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;Azure DevOps Server&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Visual Studio Team Services(VSTS)&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;Azure DevOps Services&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now due to this similar naming people often gets confused. So lets understand this in simple words,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Azure DevOps Server is the &lt;strong&gt;&lt;em&gt;on-premises&lt;/em&gt;&lt;/strong&gt; offering. It is a new release of Team Foundation Server 2018.&lt;/li&gt;
&lt;li&gt;Azure DevOps Services is the &lt;strong&gt;&lt;em&gt;cloud&lt;/em&gt;&lt;/strong&gt; offering. It is a new name given to Visual Studio Team Services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article we will discuss how we can update our on-premises TFS Server to Azure DevOps Server. Lets begin!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the latest version of Azure DevOps Server here.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install downloaded setup.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fegtnmw9ugki4f3mn6fu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fegtnmw9ugki4f3mn6fu4.png" alt="Alt Text" width="577" height="806"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once installation is complete. Configuration wizard will appear on the screen. Here it will ask for a deployment type, as we are updating the release version, select option "I have an existing database to use for this Azure DevOps Server deployment".&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmldtikzgtrm1q294lw9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmldtikzgtrm1q294lw9c.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now configuration wizard will show the databases tab. Here we will take a backup of the existing database. It is important, if something goes wrong we can restore these backups and roll back to our previous version of TFS.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo3ah9ytuu687np56t77q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo3ah9ytuu687np56t77q.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select databases which you want to backup and click on "Backup Now".&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyesi5fyun84tpl03qtgk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyesi5fyun84tpl03qtgk.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After database backups, we will choose our deployment scenario. Select "Production Upgrade" and click on the next button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7jy0at5nt5wwu1qzvslj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7jy0at5nt5wwu1qzvslj.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the account tab we will setup a user account from the given options. You can use your existing user.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm77bxy2zrh1xaep657ig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm77bxy2zrh1xaep657ig.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the application tier tab will show the existing site configuration. We can make changes if we want to otherwise just click on next.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp6z0kux15rj3y2y7ig4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp6z0kux15rj3y2y7ig4p.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If our existing on-premises server has some Search configuration settings you can configure them now.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl1pfw1r9mr3u08wk84lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl1pfw1r9mr3u08wk84lk.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After this configuration wizard will ask to review your configuration.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffmv163tw173x7ojqgnle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffmv163tw173x7ojqgnle.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once reviewed, click on the configure button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzhk3dla7g7vx712dyjk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzhk3dla7g7vx712dyjk6.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the configuration process finishes, click on the next button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fexqhx7tj5lpzr6mcz8yx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fexqhx7tj5lpzr6mcz8yx.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the configuration process gets complete. It will show a success message.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fko8pwqdamcs2awvy0hjy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fko8pwqdamcs2awvy0hjy.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Review the results and click on next.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvvzri54qbdcf1km2zj84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvvzri54qbdcf1km2zj84.png" alt="Alt Text" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We have successfully updated to the Azure DevOps Server 2019.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: In case you want to rollback to previous version perform below steps,&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Uninstall Azure DevOps Server 2019.&lt;/li&gt;
&lt;li&gt;Restore the database backup on database server which we took in the beginning of the process.&lt;/li&gt;
&lt;li&gt;Now just install TFS 2018 again and select existing database option and your good to go!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I hope this will be helpful!&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Use Git Hooks to ease your development workflow</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Fri, 17 Jul 2020 14:59:43 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/use-git-hooks-to-ease-your-development-workflow-2ijh</link>
      <guid>https://forem.com/rajhawaldar/use-git-hooks-to-ease-your-development-workflow-2ijh</guid>
      <description>&lt;p&gt;Git hooks allow us to run custom scripts whenever certain important events occur in the git repository such as commit, push, merge. Basically git hooks are stored in the .git/hook directory of your local repository.&lt;/p&gt;

&lt;p&gt;Initially all hook files contain .sample as extension, which indicate those are disabled. These sample hooks are stored in one of the below locations as per your operating system,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;: /usr/share/git-core/templates&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;: C:\Program Files\Git\mingw64\share\git-core\templates&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mac OS&lt;/strong&gt;: /usr/local/git/libexec/git-core&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whenever you initialize a local git repository these sample hooks templates which are already stored on your machine get copied into your local repository.&lt;/p&gt;

&lt;p&gt;All hooks pre-fix with pre label will execute before the particular event happens and hooks with pre-fix post will execute after the event.&lt;/p&gt;

&lt;p&gt;For Example: pre-push hook will execute before the push operation.&lt;/p&gt;

&lt;p&gt;As hooks are disabled by default, we need to perform below steps to enable them ,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove .sample extension from the hook name.&lt;/li&gt;
&lt;li&gt;Make that hook file executable using command chmod +x &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Before we start remember this:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As we see here hooks present inside .git/hook/ directory which means these are not source control. You can use symbolic link.&lt;/li&gt;
&lt;li&gt;You can bypass pre-commit git hook locally by adding --no-verify flag.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lets start with the practical use of git hooks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario 1:&lt;/strong&gt; In one of the projects we used to create a feature-branch from the environment branch(master,dev,release). We should not commit our code directly on the environment branches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; pre-commit hook is run first, so we will use this hook. copy below code snippet in your pre-commit hook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/sh
# Avoid doing commit in environment branches.


BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
forbidden_branchs="^(master|dev|release)$"


message="You should not commit directly into ${BRANCH_NAME} branch.\nPlease create a new branch from '$BRANCH_NAME' and Try again."


if [[ $BRANCH_NAME =~ $forbidden_branchs ]]
then
    echo -e $message
    exit 1
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In windows operating system instead of &lt;strong&gt;#!bin/sh&lt;/strong&gt; use &lt;strong&gt;#!C:\Program Files\Git\bin\sh.exe&lt;/strong&gt; path where git installed its shell script.&lt;/p&gt;

&lt;p&gt;Now git provides you the freedom to select scripting language. If you are comfortable with other scripting languages like python, ruby, powershell you just need to add the path of its library on the first line of the hook.&lt;/p&gt;

&lt;p&gt;Always remember, If your hooks returns &lt;strong&gt;zero&lt;/strong&gt; means that it is &lt;strong&gt;succeed&lt;/strong&gt;.  If it exists with any other number it is failed. In the above code snippet we exit code 1 which means hook failed so commit will not happen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes we amend commits multiple times and in later stages we need one of the previous state of commits. If we write a script which will make stash before committing code every time then we will get state if each and every commit in our stash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&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;if [[ $(git diff --cached --exit-code) ]];then
  BRANCH_NAME=$(git branch --show-current)
  STASH_NAME="pre-commit-on-$BRANCH_NAME-$(date +"%m-%d-%y::%T")"
  git stash save -q --keep-index $STASH_NAME
  echo "Stash:${STASH_NAME} saved!"       
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;$(git diff --cached --exit-code)&lt;/strong&gt; will check whether there is any code present in staging area. As there is no point running this code for empty commit. &lt;strong&gt;$(git branch --show-current )&lt;/strong&gt; gives us current branch name.&lt;br&gt;
We will use the same pre-commit hook. Add below line your pre-commit hook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before pushing our branches to remote lets create a hook which will execute build and tests before pushing your code to remote branch.&lt;/p&gt;

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

&lt;p&gt;We can use pre-push or pre-commit hook for this scenario.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "Running Build"
sh run-test-scripts.sh

if [ $? -ne 0 ]; then
  echo "Build must be succeed before commit!"
  exit 1
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;strong&gt;$?&lt;/strong&gt; stores the exit value of last command. Add test cases and build commands in run-test-scripts.sh file. &lt;strong&gt;You can use this hook for automatic code quality checks.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to deploy these git hooks ?
&lt;/h3&gt;

&lt;p&gt;As git hooks are stored in .git/hook directory so developers will not be able to commit these hooks. We will create our own .githooks directory in our code base. We will copy our created hooks into this newly created directory and ensure permissions are correctly set on the file.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod a+x ~/.githooks/pre-commit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Done!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is another way&lt;/strong&gt;, from git version 2.9.0 you can set &lt;strong&gt;core.hookspath&lt;/strong&gt; which will allow you to set a global directory for hooks on your machine. So all your local repository will point to that directory and use hooks present over there.&lt;/p&gt;

&lt;p&gt;To set &lt;strong&gt;core.hookspath&lt;/strong&gt; use below 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 core.hookspath &amp;lt;hooks-directory-path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note: Keep your hooks folder outside of local repository. Otherwise if you delete local repository for some reason. Your other project will not able to access the hooks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With git hooks imagination is the limit! You can find my original article on LinkedIn(&lt;a href="https://www.linkedin.com/pulse/use-git-hooks-ease-your-development-workflow-raj-hawaldar-/" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Let me know if the article is useful. &lt;br&gt;
Happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Angular Modules</title>
      <dc:creator>Raj Hawaldar</dc:creator>
      <pubDate>Sun, 03 May 2020 10:40:19 +0000</pubDate>
      <link>https://forem.com/rajhawaldar/angular-module-and-types-50kf</link>
      <guid>https://forem.com/rajhawaldar/angular-module-and-types-50kf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7u9nnowagxouwgybvxg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7u9nnowagxouwgybvxg.jpeg" alt="Image" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Module&lt;/strong&gt; is one of the fundamental concepts of &lt;strong&gt;Angular&lt;/strong&gt;. Today we are going to understand the types of module and their uses in Angular. &lt;/p&gt;

&lt;p&gt;In simple words,  &lt;strong&gt;&lt;em&gt;&lt;code&gt;Module is mechanism to group components, pipes, directives, services that are related.&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
These individual modules can be combined together to create an application. &lt;/p&gt;

&lt;p&gt;We use &lt;strong&gt;@NgModule&lt;/strong&gt; decorator to declare class as &lt;em&gt;module&lt;/em&gt;. &lt;br&gt;
&lt;em&gt;@NgModule&lt;/em&gt; decorator contains below properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;declarations&lt;/strong&gt;: It includes component, directives, pipes that belongs to &lt;em&gt;this&lt;/em&gt; module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;exports&lt;/strong&gt;: It include component, directives, pipes which can be accessible to other NgModule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;imports&lt;/strong&gt;: Contains Modules whose exported classes needed by &lt;em&gt;this&lt;/em&gt; module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;providers&lt;/strong&gt;: Contains the services generated by &lt;em&gt;this&lt;/em&gt; module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bootstrap&lt;/strong&gt;: Initialize root component&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Module Encapsulation:
&lt;/h4&gt;

&lt;p&gt;Similar to ES module, angular module also provide &lt;em&gt;encapsulation&lt;/em&gt;. We cannot use component from other module unless we define that component in imports list of current module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;AppComponent&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;BrowserModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;AppRoutingModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;SharedModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="nx"&gt;DashboardModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//  Imported members from feature module are now accessible in AppModule.&lt;/span&gt;
    &lt;span class="nx"&gt;CoreModule&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="na"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So to use exported component from other module we need to import that module first.&lt;/p&gt;

&lt;p&gt;According to type of module we are going to use above properties. &lt;/p&gt;

&lt;p&gt;There are different types of Angular Modules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RootModule&lt;/strong&gt;: Each angular application has at least one module called as &lt;em&gt;Root Module&lt;/em&gt;. Conventionally named as AppModule. We launch our by bootstrapping the root module.(check main.ts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Routing Module&lt;/strong&gt;: We use this module to load and configure angular routes.
The name of the routing module should match the name of its &lt;em&gt;companion module&lt;/em&gt;.

&lt;ul&gt;
&lt;li&gt;It does not use declarations property inside @NgModule decorator.&lt;/li&gt;
&lt;li&gt;Always exports &lt;strong&gt;RouterModule&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HomeComponent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;RouterModule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="na"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;RouterModule&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;entryComponents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppRoutingModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nx"&gt;Javascript&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use more than one routing module for &lt;strong&gt;better organization&lt;/strong&gt; and &lt;strong&gt;lazy loading&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feature Module&lt;/strong&gt;: As App gets more feature we can group those feature and create feature modules.

&lt;ul&gt;
&lt;li&gt;It contains declaration, providers (only services related to the feature)&lt;/li&gt;
&lt;li&gt;As per the standards it should export only the top component.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;DashboardComponent&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;CommonModule&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DashboardModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shared Module&lt;/strong&gt;:
Almost similar to &lt;em&gt;Feature Module&lt;/em&gt;. The only difference is they add all their declarations to the exports as well so they can be used in other module.
Mostly includes UI element like (spinners, toasters, Alerts)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AlerComponent&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AlertComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;CommonModule&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SharedModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core Module&lt;/strong&gt;: Also known as service module. 
This module does not have any declaration property as it only focuses on services.
Inside Core module we can create any service that provides data globally through out the app. Example: AuthService
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;AuthService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;UserServcie&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CoreModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you understand the use of each module it will be easy to plan development. &lt;/p&gt;

&lt;h4&gt;
  
  
  How to create module?
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;ng generate module &amp;lt;module-name&amp;gt;  --module=module&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;   ng generate module shared --module=app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;strong&gt;--module=app&lt;/strong&gt; line will register &lt;em&gt;SharedModule&lt;/em&gt; in the imports array of the &lt;em&gt;AppModule&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Most of the time developer just starts coding without second thought. Take a pause design your application with modular approach then start coding!!!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
