Answer the question
In order to leave comments, you need to log in
When should I push git push --tags?
People, something is completely confused, I don’t understand when to start git push --tags.
Is this correct for me?:
git add .
# добавили файлы к коммиту
git commit -m "first commit"
# коммитим
git tag -a v0.0.1 -m "my first version"
# прописали версию
git push --tags
# загрузили версии в гит
git remote add origin https://github.com/.git
git push -u origin master
Answer the question
In order to leave comments, you need to log in
git push will simply pour all local commits into the latest remote branch without parameters, if git knows which last one, of course,
git push with the -u flag allows you to specify which remote repository (in the question, this is origin) and which branch in it (in in the question, this is master) upload commits
git remote manages remote repositories
, in particular, git remote add adds a new one under the specified name (in the question, this is origin) and located under the specified url (in the question, this is https://github.com/.git )
git push - -tags uploads only tags to the last remote branch, without commits,
but a tag is just a symbolic link to a specific commit and there is no point in it without the commit itself
so git push --tags must come after git push
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question