git checkout - Comment puis-je vérifier une branche Git distante

Mots clés : gitgit-checkoutremote-branchgit

meilleur 5 Réponses git checkout - Comment puis-je vérifier une branche Git distante

vote vote

96

$ git fetch 
$ git branch -v -a  ... remotes/origin/test 
$ git switch test 
$ git fetch origin 
$ git branch -v -a 
$ git switch -c test origin/test 
$ man git-switch 
git checkout test 
git checkout -b test <name of remote>/test 
vote vote

85

git checkout test 
git checkout -b test HEAD 
vote vote

76

$ git branch test origin/test 
vote vote

67

$ git checkout -b remote_branch origin/remote_branch 
$ git fetch origin remote: Counting objects: 140, done. remote: Compressing objects: 100% (30/30), done. remote: Total 69 (delta 36), reused 66 (delta 33) Unpacking objects: 100% (69/69), done. From https://github.com/githubuser/repo-name    e6ef1e0..5029161  develop    -> origin/develop  * [new branch]      demo       -> origin/demo    d80f8d7..359eab0  master     -> origin/master  $ git checkout demo Branch demo set up to track remote branch demo from origin. Switched to a new branch 'demo' 
vote vote

51

git fetch origin 'remote_branch':'local_branch_name' 

Questions similaires