Contents tagged with git

  • Moving Local git Repo to GitHub

    Recently I was working on a learning type project that I considered important enough to create a local git repo for it, but not a remote one. However it got to the point that I wanted to preserve it on GitHub. I can add a repo to GitHub, link to it, then push new branches to it. The problem is that I cannot push the master and have that history. First of all there is nothing in my local repo to tell me that it is connected to any remote repo. This is the command used to determine the associated remote repo:git remote –vIn this case it returned nothing. To get where I wanted to go I created a git repo named GitToAdd. Here is the command I used to associate this remote repo with my local repo: … more

  • Creating and Running Tests

    Building out the test project NOTE: the initial test project should have been created as an xUnit project. Towards that end I have added the command: yo aspnet xunit Pubs.Data.Test --version-current to the yoCommands.txt file and run it to use that as the test project. To create tests we will need to open up the Pubs.Data.Test project, then either delete the Class1.cs file, then add a new class named StoresTest, or else rename the Class1 class to StoresTest. Next open up the csproj file and add the following lines to dependencies, either manually or by using the NuGet Package Manager extension of VS Code: "Pubs.Data": "1.0.0-*"”Microsoft.EntityFrameworkCore”: “1.1.0”,"Microsoft.Extensions. … more

  • Global Git Parameters

    There are a couple of files that git uses to do its thing. The two main ones are the .gitconfig to configure the git client, the other is the .gitignore file that is uses to determine which files get included in the repository and which do not. If you do not want to recreate these files each time, or want to change any global values you can always edit the global files directly.

    For .gitignore the file is in the users base folder, in my case C:\Users\Robert, so the file is C:\Users\Robert\.gitignore. For *nix users the file will be ~/.gitignore. Since I often use Visual Studio as we as VS Code, I have added entries for folders and file specific to those programs. So I do not have to edit … more

  • Setting Up the Projects for DotNet Core Web Api – Revisited

    Before creating any projects we will create a new branch in git locally, then push it up to The following lines of code will accomplish this:

    git checkout -b Setup_Projectsgit push origin Setup_Projects

    After this the local and remote repositories will both have a branch named Setup_Projects.

    Create Projects

    Now we are ready to create the projects that will comprise our solution. From a high level view this is what it will all look like if opened in Visual Studio:

    One thing that might jump out at you is that there is a seemingly superfluous console application. I tend to include such a project to test various thing as I develop. I find it very useful in terms of playing … more