diff --git a/README.md b/README.md index 72fd09b..34fe720 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..17759ca --- /dev/null +++ b/start.sh @@ -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