I\'m starting out using Git + GitHub.
In our distributed team, each member is creating their own branch for each issue/requirement they are allocated.
Yes, just delete the branch by running git push origin :branchname
. To fix a new issue later, branch off from master again.
after complete the code first merge branch to master then delete that branch
git checkout master
git merge <branch-name>
git branch -d <branch-name>
We request that the developer asking for the pull request state that they would like the branch deleted. Most of the time this is the case. There are times when a branch is needed (e.g. copying the changes to another release branch).
My fingers have memorized our process:
git checkout <feature-branch>
git pull
git checkout <release-branch>
git pull
git merge --no-ff <feature-branch>
git push
git tag -a branch-<feature-branch> -m "Merge <feature-branch> into <release-branch>"
git push --tags
git branch -d <feature-branch>
git push origin :<feature-branch>
A branch is for work. A tag marks a place in time. By tagging each branch merge we can resurrect a branch if that is needed. The branch tags have been used several times to review changes.