Setting up Project in git

Since this will be setup in a git repository we will start there. The simplest way to do this is to go to and create a new repository thusly:


I am naming the new repo CoreWebApiPubs, as that is the tersest, and yet most complete name in that it has all the elements necessary to understand, at a glance, as to what it is. The other thing to notice is that towards the lower left I have chosen the VisualStudio .gitignore file. That is a lengthy file but covers anything that VS or another IDE, may generate, but is relevant in git,

First off I open a Node.js command prompt. I use this command prompt since I have run into issues running npm, and other commands using a standard, or VS, command prompt, so it is a good habit for me. The dotnet cli and yo generator will work either way. Finally I go into my Projects folder, or any other folder, which will then become the parent of the root folder, and clone the repo:

git clone

There is now an additional folder in my projects folder named CoreWebApiPubs. From my command prompt I cd into that folder and see this:


The last series of steps are to add a new folder named SolutionFiles. I use this to store any ancillary files I might need in the process of developing this solution. In this case the needed files are to generate the projects using the npm tool yo (yoCommands.txt), and one containing the EntityFrameworkCore command (DataScaffolding.txt) to generate the EF code and the DTO’s. Now I get a status of the git repository, then update by running these commands:

1. git status
2. git add .
3. git commit -m "Added SolutionFiles folder and the associated files"
4. git status
5. git push origin master
6. git status
7. git branch -a

Command 1 shows the current status of the local repo. Commands 2 and 3 add the new folder and the files, files to the local repo, then commits them respectively. Command 6 updates the remote repository with the committed changes to the local repo. Here is what my command prompt window looks like after doing all that:


In subsequent posts I will create a branch for each post so that the reader can always go back to a previous branch to start over if one wishes to do so.

No Comments

Add a Comment