git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Salvet <dominik.salvet@gmail.com>
To: git@vger.kernel.org
Subject: Fetching master branch with tags associated with it
Date: Thu, 21 Feb 2019 18:02:54 +0100	[thread overview]
Message-ID: <CAEXP2g92_pnbh4_V8VOgzzdUv6w5eDhCsXf=+NOdsRwyjQUb5A@mail.gmail.com> (raw)

Dear Git community,
For quite some time I am trying to solve a problem with fetching the
master branch from a remote with tags that are pointing only to the
master branch.

Cloning the master branch of a repository with tags only pointing to
that branch is working, though. In this case, the following command
will do the work: `git clone --branch master --single-branch <url> .`

Now, I want to refresh the repository the same way - fetching only
commits from the master branch and tags that are pointing to the
master branch and also refresh those tags as well in case of their
target commit change at the remote (you can expect that it always
points to a master commit). Nevertheless, I don't really know how to
do it. The closest I got, are the following commands:

```sh
git fetch --tags origin master &&
git merge FETCH_HEAD
```

However, there obviously are some problems with this solution. The
`--tags` flag will cause to fetch tags from all branches. Furthermore,
it will fetch also their commits, which is absolutely what I don't
want to.

I have Git 2.17.1 (on Ubuntu 18.04.2) and in its `git fetch --help` is
stated, if I understood it correctly, that without passing neither
`--tags` nor `--no-tags`, it will do exactly what I want.
Nevertheless, without using any of the mentioned flags, it behaves
more like using `--no-tags`.

Am I missing something? Do you want any additional information? I
would really appreciate your help.

Thank you for all your effort
-- 
Dominik Salvet

             reply	other threads:[~2019-02-21 17:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 17:02 Dominik Salvet [this message]
2019-02-22 16:07 ` Fetching master branch with tags associated with it Jeff King
2019-02-22 16:35   ` Randall S. Becker

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

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

  git send-email \
    --in-reply-to='CAEXP2g92_pnbh4_V8VOgzzdUv6w5eDhCsXf=+NOdsRwyjQUb5A@mail.gmail.com' \
    --to=dominik.salvet@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.
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 NNTP newsgroup(s).