Sync .Net Core Project To GIT Repository

Objective

In this article, I will show you the below important steps:

  1. Create GIT repository
  2. Create branch to your Git Repository
  3. Sync Your local project to your GIT repository
  4. Commit your project
  5. Push your project file changes

Let's first create an account in GIT if you don’t have one.

Let's install the GIT bash for windows for working on GIT command in your local cm prompt

Git - Downloading Package (git-scm.com)

Create GIT repository

After loggin in to your git go to your profile ,Click “NEW” under the “Repository”

Create GIT repository

Give the Repository Name like for me “.NEtCoreAPI”. Choose public or Private and also give some input in the Description Field  and Create the “Repository” button

Create GIT repository

Now you will have all the git code created for your newly Repository

Create GIT repository

Sync your local project to your GIT repository

Go to your Project location

Sync project to your GIT repository

Type “CMD” at the taskbar and click enter

Sync project to your GIT repository

Type git init and press enter. It will Initialize empty Git repository at your project location

Sync project to your GIT repository

This will create a “.git” folder in your project location as you have mapped with git

Sync project to your GIT repository

Now like below image “open local Repository” and select your local project location

Sync project to your GIT repository

Create branch to your Git Repository

Go to the GitChanges tab

Create branch to your Git Repository

By default, it will be “Master” branch. Click New Branch button

Create branch to your Git Repository

Now Enter message for commit . Press Commit all and then presh push button

Create branch to your Git Repository

Create branch to your Git Repository

Push Operation done. You will get the below message

Create branch to your Git Repository

Now go to your git repo (NetCoreApi) and you will see your local code has been pushed into the repository

Create branch to your Git Repository

So in this article, we have seen how to push your local vs code at the git repo for the code versioning.

In my next article, I will show you how to create the Azure DevOps pipeline using your existing git repository.