Renomear Branch Remoto
Para completar este laboratório, você usará o repositório Git git-playground da sua conta GitHub, que vem de um fork de https://github.com/labex-labs/git-playground.git. Por favor, desmarque "Copy master branch only" ao fazer o fork.
Você tem um repositório Git chamado https://github.com/your-username/git-playground. Você criou um branch chamado feature-branch e o enviou para o remoto. Agora você quer renomear o branch para new-feature-1 tanto localmente quanto no remoto.
- Clone o repositório, navegue até o diretório e configure a identidade:
git clone https://github.com/your-username/git-playground.git
cd git-playground
git config --global user.name "your-username"
git config --global user.email "your-email"
- Mude para o branch chamado
feature-branch:git checkout feature-branch
- Renomeie o branch tanto localmente quanto no remoto:
git branch -m feature-branch new-feature-1
git push origin --delete feature-branch
git push -u origin new-feature-1
- Verifique se o branch foi renomeado:
git branch -a
Este é o resultado da execução de git branch -a:
* master
new-feature-1
remotes/origin/HEAD - > origin/master
remotes/origin/master
remotes/origin/new-feature-1