Using Tags – Question from former CVS user

I’m in the process of moving our CVS database over to Git. The move requires me to rethink some configurations and procedures. One of the challenges that I’m working with is that tags applies to the complete repository in Git while in CVS they can apply to a single file.

I have used CVS mainly for source code, but I have also used it for other types of files. One application that I have used CVS for and that I now want to use Git for, is version control of drawings for part numbers.

In CVS I had one module with a few hundred subfolders. Each subfolder contained drawings for one part. I would tag each folder with the revision of the drawings for that part. There was no correlation between the revisions of the drawings for the different parts.

One solution to accomplish the same thing in Git would be to make a few hundred repositories, one for each part, but this has some drawbacks. For example, it would be difficult to clone the complete part library/module to my local computer. I think that that I would have to clone each repository manually to do this.

Is there a better solution for setting something like this up in Git? Is there a different type of tag that I can apply to only a selection of files? Is there a way to clone all repositories with one command?

Thanks for your help!

1 Like

What’s about using sub module, have a look here.

1 Like

The workflow could look like this:

  • Add a submodule to the main repository like this
git submodule add draw1 https://gitlab.server/drawing-orga/draw1.git
  • Each submodule directory can be operated as git repository (depending on the authorization, you can even tag and push in there)
cd draw1
git tag v1.0.0
git push 
cd ..
  • On the main repository, investigate with git status and see that there is a new submodule and directory
git status
git commit -av -m "Add submodule for draw1 repo"
  • Pull changes from the submodules
cd draw1
git pull
# or git fetch and checkout a specific tag with: git fetch && git checkout v1.1.0
cd ..

git commit -av -m "Pulled updated draw1 repo"

And so on. I’d suggest playing around in a test repository structure first to get an idea about submodule handling, before you add this to “production”.