![]() ![]() In this tutorial, we learned why we might need to create a new git branch from a tag for debugging and how this can be achieved with the "git checkout" command. Now we have a new branch "debug-tag-2-0" ready for debugging on local. Check if everything is good (fetch origin and list remote branches): git fetch origin git branch -r. Can someone tell me whats wrong with my action Im trying to create a new branch off a remote branch, and push the new branch to my repository. $ git tag -lĪfter confirming that tag v2.0 fetch properly, we can now run the "git checkout" command to create the new branch from that tag. Add a remote branch: git push origin master:newfeaturename. ![]() Now confirm that you have fetched the required tag v2.0 from which you want to create the branch. Make sure you fetch all the tags from your remote repository with the "git fetch" command $ git fetch -all -tags 2. The easiest way to set the upstream branch is to use the git push command with the -u option for upstream branch. Now let's go through each step one by one to create a new branch from the correct tag. Now creating a debug branch from the tag v2.0 will be the best way to make sure you have the exact code which is deployed on production. Letâs say you have deployed tag v2.0 on production and now you have some issues after the deployment. But sometimes you might want to debug the deployed code and the best way is to create a new GIT branch from that tag. GIT tags are created to mark a specific point in git history and then deployed. Where is typically origin, the name which git gives to the remote you cloned from. So when you feel ready for it, you can just do: git push .Create a local branch and track the remote branch: git checkout -tb newfeaturename origin/newfeaturename. ![]() Check if everything is good (fetch origin and list remote branches): git fetch origin git branch -r. A new GIT branch can be created from a tag through the âgit checkoutâ command with the â-bâ option followed by a new branch name and tag name. The remote branch is automatically created when you push it to the remote server. Add a remote branch: git push origin master:newfeaturename. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |