Difference Between Fetch and Pull Git Commands

In this blog post, we will learn about the difference between the get Fetech and pull commands, which are commonly used when working with a centralised code repository like Azure DevOps, etc.


Consider the scenario. Our code repository is hosted on Azure DevOps, and we are using code editors like Visual Studio or Visual Studio code. We need to use the following commands, either through the command line or using the visual options available in our code editor tools.

Git Fetch:

The "git fetch" command is used to retrieve changes from a remote repository to your local repository. It doesn't automatically merge or apply these changes to your local branch. It only updates your local references to the remote branches.

Scenario

when you want to see what changes are available in the remote repository without merging them into your working branch immediately. It's helpful for reviewing changes before deciding to incorporate them into your codebase.

In short, use "git fetch" when you want to see the new changes in the remote repo but don’t want to change your local repo yet.

Example:

#Fetch changes from the remote repository (origin in this case)
git fetch origin

#List branches, including remote branches, to see what's available
git branch -a

After using fetch, your local repo stays the same until you decide to add the new changes.

Git Pull:

The "git pull" command is used to fetch changes from a remote repository and automatically merge them into your current local branch. It is essentially a combination of "git fetch" and "git merge."

Scenario

When you want to quickly update your local branch with the latest changes from the remote branch, you are fine to merge them into your working branch after verifying the changes and knowing any implications.

Example

#Pull changes from the remote repository (origin) and merge them into the current branch
git pull origin dev

In this example, "dev" is the branch you want to pull changes from. The "git pull" command will fetch changes from the remote "dev" branch and merge them into your current local branch.

Summary

In summary, use "git fetch" to just see the new changes from the remote repo, and use "git pull" when you are ready to add those changes to your local repo quickly. Choose what’s right for you at the moment.

How To Connect Azure Kubernetes Cluster Using Kubectl

Connecting to an Azure Kubernetes Service (AKS) cluster is a crucial step in managing and interacting with the resources on the cluster. In this article, we will go through the process of connecting to an AKS cluster using kubectl commands with examples and the command in the console. 

Install Azure CLI

The first step is to install the Azure CLI. This tool is required to authenticate to the AKS cluster. You can install the Azure CLI by following the instructions provided by Microsoft at the following link: 

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Install kubectl

Next, we need to install kubectl, which is the command-line tool for interacting with Kubernetes clusters. You can install kubectl by following the instructions provided by Kubernetes at the following link:

Authenticate to the AKS cluster

To authenticate to the AKS cluster, you will need to run the following command, replacing "myResourceGroup" and "myAKSCluster" with the appropriate values for your cluster:

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

This command will configure kubectl to use the credentials of the AKS cluster, allowing you to interact with the cluster using kubectl commands.

Verify the connection:

Once you have authenticated to the AKS cluster, you can verify the connection by running the following command:

kubectl get nodes

This command will display a list of the nodes in the AKS cluster, indicating that you have successfully connected to the cluster. The output should look something like this:


Summary

I hope from the preceding step-by-step explanation you have learned how to connect to an existing Azure Kubernetes Service (AKS) cluster using kubectl commands.

Difference Between Git Fetch Vs Pull

In Git, both "fetch" and "pull" are commands used to update your local repository with changes from a remote repository. However, they work slightly differently in terms of what they do and how they do it. Let's explore the differences between "fetch" and "pull" in the context of Azure DevOps and provide examples for each.

Git Fetch:

Purpose:

The "git fetch" command is used to retrieve changes from a remote repository (such as the one hosted on Azure DevOps) to your local repository. It doesn't automatically merge or apply these changes to your working branch; it only updates your local references to the remote branches.

Use Case:

Use "git fetch" when you want to see what changes are available in the remote repository without merging them into your working branch immediately. It's helpful for reviewing changes before deciding to incorporate them into your codebase.

Example:

#Fetch changes from the remote repository (origin in this case)
git fetch origin

#List branches, including remote branches, to see what's available
git branch -av

This will fetch all the changes from the remote repository, but your local working branch won't be updated automatically.

Git Pull:

Purpose

The "git pull" command is used to fetch changes from a remote repository and automatically merge them into your current local branch. It is essentially a combination of "git fetch" and "git merge."

Use Case

Use "git pull" when you want to quickly update your local branch with the latest changes from the remote branch and are ready to merge them into your working branch.

Example

#Pull changes from the remote repository (origin) and merge them into the current branch
git pull origin dev

In this example, "main" is the branch you want to pull changes from. The "git pull" command will fetch changes from the remote "main" branch and merge them into your current local branch.

Summary

I hope from all the above examples you have learned that "git fetch" is useful for checking what changes are available in the remote repository without immediately applying them to your working branch. On the other hand, "git pull" fetches and merges changes from the remote repository into your current branch in one step. Choose the one that best fits your workflow and needs in Azure DevOps.

If you like my blog's contents, don't forget to share them with your friends and explore other topics on my blog.

How to Get Free Access to Azure DevOps Build Agents

 Microsoft has changed the policy to allow the free tier of hosted agent pools for public and private projects of newly created DevOps organisations by citing the reason that many are abusing this feature by sending a huge amount of traffic to these hosted agent pools. For this reason, many are getting the following error during the build pipeline.

No hosted parallelism has been purchased or granted. To request a free parallelism grant, please reach out to azpipelines-freetier@microsoft.com with your name and organization name.


The sudden change is causing lots of trouble for those who have been using the feature for a long time, particularly those who are community contributors (public speakers, bloggers, etc.). Obviously, many users across the world disagree with the change and the restrictions.

How do I get free access to the Azure DevOps Build Agent Pools?

Microsoft devises some temporary workarounds until the automated solution is implemented to grant permission to those users who require free hosted agent pools.

Now users need to drop their email to get the free tier access based on the project visibility types, which is explained below.

As you know, there are two types of repositories you can create, as mentioned below, and based on project types, the build agent pools are different.

  • Private
  • Public

Private Project

To get the free tier access of Microsoft hosted agent pools for private projects, send an email to azpipelines-freetier@microsoft.com with the following details:

Public Project

To get the free tier access of Microsoft's hosted agent pools for public projects, send an email to azpipelines-ossgrant@microsoft.com with the following details:
  • Your Name
  • Microsoft azure DevOps organization name (dev.azure.com/yourorganization)
  • Link of the repositories you want to build
  • Short description of your project.

Update (03-12-2022)

Microsoft introduced the form instead of email, so you can fill out the below form using the following link:

How soon will I get the free grant after the email?

There is no defined timeline for approval in which someone can expect approval within your expected days, but by considering the mass requests and manual approval process, we can consider a timeline of 7 to 15 working days from your email.

Summary

I hope you came to know the root cause of the issue, and some of you got help on how to get the free grant. If you have any doubts, then please send them using the comment box.

Related Articles

Microsoft Restricted Free Use of Azure DevOps Pipelines

Microsoft has changed the policy to allow the free tier of a hosted agent pools for public and private projects of newly created DevOps organizations by citing the reason that many are abusing this feature by sending a huge amount of traffic on these hosted agents pools. Due to this reason, many are getting the following error during the build pipeline.

No hosted parallelism has been purchased or granted. To request a free parallelism grant, please reach out to azpipelines-freetier@microsoft.com with your name and organization name.


The sudden change is causing lots of trouble for those who have been using the feature for a long time, particularly those who are community contributors (public speakers, bloggers etc.). Obviously, many users across the world disagree with the change and restriction.

How to get a free parallelism grant?

Microsoft comes with the some temporary alternative approach until the automate is implemented to grant the permission for those users who requires the free hosted agent pools. 

Now users needs to be drop the email to get the free tier access based on the project visibility types which is explained below

Private Project

To get the free tier access of Microsoft hosted agent pools for private projects, send the email to azpipelines-freetier@microsoft.com with the following details.

  • Your Name
  • Microsoft azure DevOps organization name (dev.azure.com/yourorganization)

Public Project

To get the free tier access of Microsoft hosted agent pools for public projects, send the email to azpipelines-ossgrant@microsoft.com with the following details.
  • Your Name
  • Microsoft azure DevOps organization name (dev.azure.com/yourorganization)
  • Link of the repositories you want to build
  • Short description of your project.

Update (03-12-2022)

Microsoft introduced the form instead of email, so you can fill out the below form using the following link:

How soon will I get the free grant?

There is not a standard timeline for approval which someone can predict approval in days, but by considering the mass requests and manual approval process we can consider the timeline of 2 to 3 working days.

You can get the more details using the following link.

Summary 

I hope you came to know the root cause of the issue, and some of you got help on how to get the free grant. If you have any doubts, then please send using the comment box.

No hosted parallelism has been purchased or granted Azure DevOps

Microsoft has changed the policy to allow the free tier of a hosted agent pools for public and private projects of newly created DevOps organizations by citing the reason that many are abusing this feature by sending a huge amount of traffic on these hosted agents pools. Due to this reason, many are getting the following error during the build pipeline.

No hosted parallelism has been purchased or granted. To request a free parallelism grant, please reach out to azpipelines-freetier@microsoft.com with your name and organization name.


The sudden change is causing lots of trouble for those who have been using the feature for a long time, particularly those who are community contributors (public speakers, bloggers etc.). Obviously, many users across the world disagree with the change and restriction.

How to get a free parallelism grant?

Microsoft comes with the some temporary alternative approach until the automate is implemented to grant the permission for those users who requires the free hosted agent pools. 

Now users needs to be drop the email to get the free tier access based on the project visibility types which is explained below

Private Project

To get the free tier access of Microsoft hosted agent pools for private projects, send the email to azpipelines-freetier@microsoft.com with the following details.

  • Your Name
  • Microsoft azure DevOps organization name (dev.azure.com/yourorganization)

Public Project

To get the free tier access of Microsoft hosted agent pools for public projects, send the email to azpipelines-ossgrant@microsoft.com with the following details.
  • Your Name
  • Microsoft azure DevOps organization name (dev.azure.com/yourorganization)
  • Link of the repositories you want to build
  • Short description of your project.

Update (03-12-2022)

Microsoft introduced the form instead of email, so you can fill out the below form using the following link:

How soon will I get the free grant after the email?

There is not a standard timeline for approval which someone can predict approval in days, but by considering the mass requests and manual approval process we can consider the timeline of 7 to 15 working days from your email.

You can get the more details using the following link.

Summary 

I hope you came to know the root cause of the issue, and some of you got help on how to get the free grant. If you have any doubts, then please send using the comment box.

www.CodeNirvana.in

Protected by Copyscape
Copyright © Compilemode