git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sivanandan Srilakshmanan <ssrilaks@gmail.com>
To: git@vger.kernel.org
Subject: Tagging from within a worktree causes fatal: tag already exists
Date: Thu, 9 Jul 2020 21:20:47 +1000	[thread overview]
Message-ID: <CACKP9csQxeWeKjEB8RPa=hdMpOAFtXt3_WErxk8cdR1soNu+Fw@mail.gmail.com> (raw)

Hi,

I have been using git and worktree for about 8 months and getting my
team upto speed, with absolute success. Thanks for your help during my
initial stages.

I am in the production readiness phase and wanted to merge the branch
into master, tag and deploy into UAT.

When I run "git tag -l" on any worktree, they all list the tag created
in proj1 (1.0.0-1).
But when I run "git show 1.0.0-1" it is associated only with proj1
(see listing below)
The issue is, I am unable to create a tag 1.0.0-1 in any other worktree.

In summary, I performed the following steps.  proj1 & proj2 are two
different git repositories.
1. Checked out master (proj1) into a local-directory-proj1-master using worktree
2. Merged the dev-branch into master
3. Pushed the change to central server
4. From the local-directory-proj1-master, I created a tag (1.0.0-1)
5. pushed the tag  to central server

6.  Checked out master (proj2) into a local-directory-proj2-master
using worktree
     Performed steps 2 & 3 above for proj 2

7.  From the local-directory-master (proj2) , I created a tag (1.0.0-1)
     fatal: tag '1.0.0-1' already exists

Your assistance is greatly appreciated.

Thanks
Lakshman



Please find detail steps below

proj1 => remote (origin)
Local_proj1-DEV => Development Branch
proj1/master    => Remote Tracking branch

git worktree add --checkout c:\source\proj1-master -b
Local-proj1-master proj1/master

cd c:\source\proj1-master

C:\Source\proj1-master>git merge Local_proj1-DEV

C:\Source\proj1-master>git push proj1 HEAD:master

C:\Source\proj1-master>git tag -a -m "Initial release candidate" 1.0.0-1

C:\Source\proj1-master>git show 1.0.0-1
tag 1.0.0-1
Tagger: Lakshman <sadsd>
Date:   Thu Jul 9 17:38:23 2020 +1000

Initial release candidate

commit 99fe92 (HEAD -> Local-proj1-master, tag: 1.0.0-1, proj1/master,
proj1/dev, Local_proj1-DEV)

git push proj1 1.0.0-1




cd c:\source\proj2-master

C:\Source\proj2-master>git tag 1.0.0-1
fatal: tag '1.0.0-1' already exists

c:\source\proj2-master>git show 1.0.0-1
tag 1.0.0-1
Tagger: Lakshman <sadsd>
Date:   Thu Jul 9 17:38:23 2020 +1000

Initial release candidate

commit 99fe92 (tag: 1.0.0-1, proj1/master, proj1/dev, Local_proj1-DEV,
Local-proj1-master)

                 reply	other threads:[~2020-07-09 11:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACKP9csQxeWeKjEB8RPa=hdMpOAFtXt3_WErxk8cdR1soNu+Fw@mail.gmail.com' \
    --to=ssrilaks@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).