| | 123 | |
| | 124 | === Listing Branches === |
| | 125 | |
| | 126 | The following will show you a list of branches: |
| | 127 | |
| | 128 | {{{ |
| | 129 | git branch |
| | 130 | }}} |
| | 131 | |
| | 132 | === Creating a tag from the current branch === |
| | 133 | |
| | 134 | Before we create a tag lets change the testfile: |
| | 135 | |
| | 136 | {{{ |
| | 137 | echo "Testing Tag testing-1.0" > testfile |
| | 138 | git add testfile |
| | 139 | git commit -m "Change the test file before tagging." |
| | 140 | }}} |
| | 141 | |
| | 142 | Finally create a testing-1.0 tag: |
| | 143 | |
| | 144 | {{{ |
| | 145 | git tag testing-1.0 |
| | 146 | }}} |
| | 147 | |
| | 148 | Its good to know that when you create a Tag, you stay in the current branch. It doesn't switch its current working ref to the tag. Its also good to know that when you checkout a tag, you can't commit changes to the tag. If you want to make changes you should change the branch the tag was created from or create a new branch from the tag using git checkout -b. |
| | 149 | |
| | 150 | === Listing Tags === |
| | 151 | |
| | 152 | The following will show you a list of tags: |
| | 153 | |
| | 154 | {{{ |
| | 155 | git tag |
| | 156 | }}} |