0

We have a considerably sized Git (full clone is 0.5 GB)

We use Git tags to mark CI/CD progress pr. commit.

We are facing a problem were we are unable to tag, without cloning first - meaning that every time we want to tag a commit, we need to clone the repo first.

My question is: Is there any way to tag a Git commit when Git server is on-premise BitBucket.(Stash), without cloning the repo locally?


Clarification:

This is a question regarding the newest version of Git on the newest version of BitBucket

A local repo is not available on all machines in our CI/CD process

Our CI/CD setup is one machine for Bamboo build and another for Octopus Deploy - and it is on the Octopus machine (which have no repo clone) that we want to do the tagging

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67
Casper Leon Nielsen
  • 2,528
  • 1
  • 28
  • 37
  • Possible duplicate of [Tag a remote git repository without cloning it](http://stackoverflow.com/questions/6922700/tag-a-remote-git-repository-without-cloning-it) – scipilot Aug 29 '16 at 12:42
  • 2
    You should be able to tag it in the bare repo if you can access it in your CI host. I've marked this as a duplicate, the answer is `git tag build-1234 master` in http://stackoverflow.com/questions/6922700/tag-a-remote-git-repository-without-cloning-it – scipilot Aug 29 '16 at 12:43
  • Hi @scipilot I have updated to reflect your questions: We do not have access to a local clone of the repro when we want to tag, hence the question "a problem were we are unable to tag, without cloning first " – Casper Leon Nielsen Aug 29 '16 at 12:53
  • 2
    Git only operates on local files and has no facilities for modifying a remote repository other than through fetch/push operations. – larsks Aug 29 '16 at 13:59
  • 1
    Casper, the bare repo is on the Stash host, fortunately for you its on premise so if you can ssh to it, you can find the repo and operate on it with git commands. According to that linked question you can perform most operations on a bare repo (i.e. without a working folder), including tagging. If you cannot access the host then you may be able to do it via a post-commit hook. – scipilot Aug 29 '16 at 21:00
  • Most (currently all) of the comments here are based on the (invalid) assumption that this question relates to raw GIT operations. – Casper Leon Nielsen Aug 31 '16 at 07:59

1 Answers1

1

This is possible using Bitbucket Server 4.7 or above in the UI or via REST. Details: https://confluence.atlassian.com/display/BitbucketServer/Bitbucket+Server+4.7+release+notes

Rog
  • 4,075
  • 2
  • 24
  • 35