# Setup: Verify your setup

Check every tool, then write a C# program, commit it with Git, push it to GitHub, and run a query in SQL Server.

Novice · Operating System · Git · C# · Updated October 29, 2026

## After this lesson you can

- Check from Git Bash that each course tool is installed
- Publish a new project to GitHub with git init, add, commit and push

## Key takeaways

- Each tool's `--version` command in Git Bash should print a version number. `command not found` means going back to that tool's Setup exercise.
- `git init` makes a folder a repository, `git add` chooses the files to save, and `git commit -m` saves them with a message.
- To publish, create an empty GitHub repository, link it with `git remote add origin`, then send your commit with `git push -u origin main`.

**Windows only.** This last exercise checks that your tools work together. You will write a small C# program, save it with Git, publish it on GitHub, and ask SQL Server a question.

## Check every tool

Open Windows Terminal. It should open in Git Bash. Run these commands one at a time:

```bash
git --version
dotnet --version
code --version
node --version
npm --version
```

Each one should print a version number. `dotnet --version` should start with `10.0`, and `node --version` with `v24`. If any of them prints `command not found`, go back to that tool's Setup exercise.

## Write a C# program

Create a folder for your course work and a project folder inside it:

```bash
mkdir -p ~/bootcamp/hello-csharp
cd ~/bootcamp/hello-csharp
```

Open a new C# file in VS Code:

```bash
code hello.cs
```

Type this program into the file, then save it with **Ctrl+S**:

```csharp
Console.WriteLine("Hello, C#! My computer is ready.");
```

Back in Git Bash, run it:

```bash
dotnet run hello.cs
```

The first run takes a few seconds while .NET builds your program. Then you should see:

```text
Hello, C#! My computer is ready.
```

See your project in File Explorer too:

```bash
explorer .
```

File Explorer opens `C:\Users\` followed by your username and `\bootcamp\hello-csharp`, with your `hello.cs` file inside.

## Save it with Git

```bash
git init
git add hello.cs
git commit -m "My first C# program"
```

`git init` makes this folder a Git repository. `git add` chooses the file to save, and `git commit` saves it with a message. You should see `1 file changed`.

## Publish it on GitHub

1. Sign in at [github.com](https://github.com). Click the **+** at the top right and choose **New repository**.
2. Set **Repository name** to `hello-csharp`. Leave everything else as it is: **do not** add a README, a .gitignore, or a license.
3. Click **Create repository**.

GitHub shows a page of commands. Under **…or push an existing repository from the command line**, copy the line that starts with `git remote add origin` and run it. It looks like this, with your username:

```bash
git remote add origin https://github.com/your-username/hello-csharp.git
```

Then push your commit:

```bash
git push -u origin main
```

The first time you push, Git Credential Manager opens a **Connect to GitHub** window. Choose **Sign in with your browser**, then click **Authorize** on the GitHub page. After that, Git remembers you.

Refresh the repository page on GitHub. You should see `hello.cs`. Click it to read your code online.

## Check Visual Studio and SQL Server

1. Open **Visual Studio 2026**. The start window should offer **Create a new project**. Close it.
2. Open **SQL Server Management Studio 22** and connect to `localhost` with **Windows Authentication** and **Trust server certificate** checked.
3. Click **New Query**, type `SELECT @@VERSION;`, and press **F5**. The result starts with `Microsoft SQL Server 2025`.

You did it! Your computer is ready for the course.

## Common problems

| What you see | What to do |
|---|---|
| `error: src refspec main does not match any` | The commit did not happen. Run the `git add` and `git commit` commands again, then push. |
| `remote origin already exists` | You ran `git remote add` twice. Run `git remote set-url origin` followed by the address from GitHub. |
| `Author identity unknown` | Set your name and email again, as in the Git Setup exercise. |
| `error CS1002: ; expected` | The semicolon at the end of the line is missing. Add it, save, and run again. |
| `Couldn't find a project to run` | You aren't in the `hello-csharp` folder, or the file isn't called `hello.cs`. Run `ls` to see what's there. |
| VS Code saved the file as `hello.cs.txt` | Rename it in File Explorer (with file extensions showing) to `hello.cs`. |

## Check yourself

2 questions to try on the lesson page.

## So what

Write, run, save, publish: you just did the whole loop a developer repeats every day, on your own computer, with the same tools professionals use.

## Key terms

- git init
- git add
- git commit
- git push

Source: https://www.ask-codey.com/lessons/csharp-setup-verify
