Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


Hi,

On Fri, Sep 15, 2017 at 06:33:17PM +0200, Stephan Bergmann <sbergman@redhat.com> wrote:
if [ ... ]; then
  git fetch --prune --tags origin
  # cleanup all patched stuff - probably not needed
  git reset --hard
  git checkout --detached "origin/${my_gitbranch?}"

Whether the above git fetch will put origin's master branch to
origin/master or master (the later case is what you call "tags and
branches behave the same way") depends on the refspec of the remote
named "origin", which is configured when the "origin" remote is created.

Depending on 'git remote add' was invoked with the --mirror=fetch
option (either directly or via 'git clone --mirror') .git/config
contains something like:

[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*

(normal case, master is available as origin/master)

or

[remote "origin"]
        fetch = +refs/*:refs/*

(mirror case)

So if the refspec is set up correctly, you should be able to
transparently use tags/branches the same way.

(Normally it's valuable that origin's master is written to
origin/master, so your local master branch does not change when you do
'git fetch', that's why --mirror=fetch is not the default.)

Regards,

Miklos

Attachment: signature.asc
Description: Digital signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.