16

When making a GitHub commit, how do I tag it using the git command-line options before pushing it to remote repo?

Can something like this be done? git commit -m 'first commit' -tag -a v0.0.1 -m "1st release"

Enkouyami
  • 265
  • 1
  • 3
  • 13

1 Answers1

23

AFAIK, you cannot commit & tag in one command.

git commit -m "prepare for v1.0.0 release"
git tag v1.0.0
git push origin master --tags

All you can do is connect commands via &&:

git commit -m "prepare for v1.0.0 release" && git tag v1.0.0 && git push origin master --tags
Tomas Votruba
  • 23,240
  • 9
  • 79
  • 115