Can I push a commit made in a separate state HEAD

Using git, I would like to go into a separate HEAD state and create a new commit. Then I would like to create a tag and click on the โ€œreleased latchโ€ and the tag on the remote repo. Is it possible?

If I create a separate commit in my local repo and create a tag, I can check the tag to return to this state. I would like to share this with a remote repo so that other uses can clone the repo and check the tag and get to the same state.

The reason I want to do this is because the build process must capture assembly # in the file, but I donโ€™t want to pass it to the branch where development continues. I want the commit to be separate, but also want to commit the commit and tag it so that everyone can check the tag and files that are included in the assembly. Is it recommended to drag the commit to another branch, for example "build"?

+4
source share
2 answers

, this-by "this" : " , ?" - . , git push , Git (, ssh://... https://... Git -), ( s) , , Git: ", , , ()".

, Git . , origin ( ):

git push origin <tag>

refs/tags/tag, . (, v2.x v), ( ).

, , Git. - :

git push origin HEAD:refs/heads/newbranch

git push origin HEAD:refs/tags/newtag

, , newbranch newtag. , , , , , , , .

, , , , - , . rejected push. ( git push --force + refspec), , ( , Git),.

+6

git tag mytag git push origin mytag:mytag mytag: mytag refs/tags/mytag: refs/tags/mytag

0

All Articles