bashgitgit-tag

what are proper steps for adding git tag to a commit in bash?


I need to start adding a tag to my commits... I use bash shell. what is the proper sequence

I did it like this:

git tag <verbiage>
git commit <verbiage>

Is this correct?


Solution

  • You'd usually create a tag to point to a commit after you created it:

    # Do some work
    
    # Stage the files
    git add relevant_file_1.txt relevant_file_2.txt
    
    # Commit it
    git commit -m "Version 1 ready"
    
    # tag that commit
    git tag version_1