tag tag tag!

The problem

Lot of branches, therefore much disorder. To solve this we can tag and archive.

To keep the git repo tidy we usually recommend to avoid leaving open branches that have already been merged to the main branch.

How to tag a branch and then close correctly on local and remote repos..

1 - Create the tag (locally)
     git tag archive/<branchname> <branchname>
2 - push the new tag to remote
     git push --tags
3 - delete branch locally
     git branch -d <branchname>
4 - delete branch on remote repo
     git push origin --delete <branch_name>
5 - go to master branch (or other branch)
     git checkout master

How to recover older tagged branch

1 - go to tag
     git checkout archive/<branchname>
2 - recreate branch
     git checkout -b new_branch_name

This is all for now! matta ne!

Leave a Reply

Your email address will not be published. Required fields are marked *