Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# git-exercises
## Tag It

You are developing an application and **initially released it as version** `0.1.0`. After adding new functionality, you decided to **release a new version**.

The goal of this exercise is to **commit the new functionality** and **tag it** as `v0.2.0`, marking a new release of the application.

> Tip: Ensure the tag name is exactly `v0.2.0`; otherwise, the exercise will be marked as failed.
42 changes: 42 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

mkdir -p App/src

echo 'using System;

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("v0.1.0");
}
}' > App/src/Program.cs

git add App/src/Program.cs
git commit -m "Initial release"

version1=v0.1.0
version2=v0.2.0

if git rev-parse "$version1" >/dev/null 2>&1; then
git update-ref -d "refs/tags/$version1"
fi

if git rev-parse "$version2" >/dev/null 2>&1; then
git update-ref -d "refs/tags/$version2"
fi

git tag "$version1"

echo 'using System;

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("Added a new functionality!");
Console.WriteLine("v0.2.0");
}
}' > App/src/Program.cs