On Thu, 17 Jul 2014 02:57:59 -0700 (PDT)
"seonguk.baek" wrote:
> I want to create bare git project without tags using clone.
>
> But there is no option like "--no-tags".
>
> Is there any way to clone without tags like below?
>
> $ git clone {path}/test.git --no-tags --mirror
That would have no sense: to mirror means to mirror, that is, have
everything the source has.
But you can do the required stuff by hand:
1) Initialize a bare repo:
mkdir foo
cd foo
git init --bare
2) Add your remote and configure the proper refspec for it:
git remote add origin
git config remote.origin.fetch +refs/heads/*:refs/heads/*
git config remote.origin.tagopt --no-tags
(Note that if you're calling this interactively in a POSIX-compliant
shell, you might need to enclose the refspec in single quotes or
escape each asterisk with a single backslash--to prevent the
shell from trying to glob-expand them.)
3) Get the data:
git remote update origin
If you want tags to be omitted just on the very first fetch, then omit
setting the remote..tagopt variable and use the
git fetch --no-tags
for fetching the data instead. Note that the next fetch without
"--no-tags" will fetch the auto-fetchable tags unless you set the
remote..tagopt configuration option before that.
--
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.