All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Carlos Santana <neubyr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: immutable tags?
Date: Mon, 28 Dec 2009 14:22:34 -0800 (PST)	[thread overview]
Message-ID: <m38wcmd9is.fsf@localhost.localdomain> (raw)
In-Reply-To: <92c9564e0912281204h13c6a566w95069023e6909eda@mail.gmail.com>

Carlos Santana <neubyr@gmail.com> writes:

> I would like to know if there is any difference between branches and
> tags. Is it only conceptual - convention to be followed by a developer
> or some technical difference?  e.g. : Is it possible to create
> immutable tags so that nothing can be checked in to that 'tagged
> directory'?

There is difference.  You can commit only on top of local branches, in
the refs/heads/* namespace (or on top of detached HEAD).

For branches:

  $ git checkout A   # switches current branch, HEAD points to A
  $ git commit       # creates new commit on branch A, A advances (changes)

  * by default fetch gets all branches
  * by default push transfers matching branches
  * default refspec is refs/heads/*:refs/remotes/origin/*

For tags:

  $ git checkout B   # detaches HEAD, HEAD points directly to B^{} commit
                     # you are on 'no branch'
  $ git commit       # advances HEAD, tag B does not change

  * by default fetch autofollows tags (gets tags that point to commits
    you have)
  * you need to push tags explicitely
  * default refspec is refs/tags/*:refs/tags/* (mirror 1:1)

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      parent reply	other threads:[~2009-12-28 22:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-28 20:04 immutable tags? Carlos Santana
2009-12-28 20:25 ` david
2009-12-28 20:39   ` Carlos Santana
2009-12-28 21:15     ` david
2009-12-28 20:58 ` Matthieu Moy
2009-12-28 21:21 ` David Kågedal
2009-12-28 22:22   ` Carlos Santana
2009-12-28 22:22 ` Jakub Narebski [this message]

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=m38wcmd9is.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=neubyr@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.