Git – Tagging Portions of a Git Push

git

I'm very new to git, but last week I installed it, set up bitbucket, and pushed my current project to my first bitbucket repo. All went well and I'm pleased with git as a simple, powerful, yet free way to back up my source code offsite, as well as keep track of my changes.

My next step is to keep track of actual version numbers. I'm developing in Visual Studio, where the version numbers live in the project's assembly information. I've read that version numbers are usually tracked in git with tags, so I went to tag my commit with the current version number I'm on. At this point I realized that the project that I linked to my bitbucket repo contains two projects, an application and a set of web services. At this moment they share the same version number, but most likely in the future they will have differing version numbers.

Right now each of these projects is in their own folder in the repo's root directory. Is there a way for me to mark one of these directories with one tag, and the other directory with another? Or should I step back and create two separate repos, one for the application, and the other for the web services?

Best Answer

A tag always points to a specific commit, so no. A commit is a given state of the repo in time. You can either use two different sets of tags (e.g. web-v-2.1 and services-v-5.2) or break up the projects into their own repositories.

At the end of the day, I don't think you really care if a tag contains a specific set for the other folder. I'd just pick tags that represent what I was interested in even if it applies to the entire repo when describing just part of it.