S
S
sorry_i_noob2018-01-31 09:37:11
git
sorry_i_noob, 2018-01-31 09:37:11

Git - tags. To tag a commit, you first need to create it, then take the hash of the commit and apply the git tag? Or it is possible at once during commit?

Hello. Reading the Git documentation:

https://git-scm.com/book/ru/v2/%D0%9E%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-Git-%D0%A0%D0%B0%D0%B1%D0%BE%D1%82%D0%B0-%D1%81-%D0%BC%D0%B5%D1%82%D0%BA%D0%B0%D0%BC%D0%B8

It says how to put a label on an already prepared commit. But how to hang up at once - at commit - it is not told. Is this possible at all?
And another question. On the same page it says:
Now, if someone clones or git pulls from your repository, they will get your tags on top of everything else.

What about fetch? Tags won't load?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Raimon, 2018-02-08
@Raimon

In the git, everything is extremely simple. tag and even branch is just a link to a commit, that is, a file for tag/branch is created on disk, which contains the hash of the commit to which it refers. Hence the conclusion, to create a tag you need a commit.
What pull/fetch seems to be is almost the same - fetch is a simple command that fetches changes from a remote repository, while pull is a compound command that internally calls fetch first, then rebase for example.
Branches and tags can be obtained by cloning a repository, but for this the tag must be pushed to this repository.
Read more here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question