Basculer vers une branche
Vous avez travaillé sur un projet dans un référentiel Git nommé https://github.com/labex-labs/git-playground. Votre équipe a créé une nouvelle branche nommée feature-1 pour travailler sur une nouvelle fonctionnalité. Vous devez basculer vers la branche feature-1 pour continuer à travailler sur la fonctionnalité.
- Clonez le référentiel Git :
git clone https://github.com/labex-labs/git-playground.git
- Accédez au répertoire du référentiel :
cd git-playground
- Liste toutes les branches dans le référentiel :
git branch
Sortie :
feature-1
* master
- Basculez vers la branche
feature-1 :
git checkout feature-1
Sortie :
Switched to branch 'feature-1'
- Vérifiez que vous êtes maintenant sur la branche
feature-1 :
git branch
Sortie :
* feature-1
master