how to clone all remote branches in git
2017-07-04 21:51
477 查看
from:https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git
|
3659down voteaccepted | First, clone a remote Git repository and cd into it: $ git clone git://example.com/myproject $ cd myproject Next, look at the local branches in your repository: $ git branch * master But there are other branches hiding in your repository! You can see these using the -aflag: $ git branch -a * master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental If you just want to take a quick peek at an upstream branch, you can check it out directly: $ git checkout origin/experimental But if you want to work on that branch, you'll need to create a local tracking branch which is done automatically by: $ git checkout experimental and you will see Branch experimental set up to track remote branch experimental from origin. Switched to a new branch 'experimental' That last line throws some people: "New branch" - huh? What it really means is that the branch is taken from the index and created locally for you. The previous line is actually more informative as it tells you that the branch is being set up to track the remote branch, which usually means the origin/branch_name branch Now, if you look at your local branches, this is what you'll see: $ git branch * experimental master |
相关文章推荐
- clone & push all remote branches with git
- How to provide username and password when run "git clone git@remote.git"? - Stack Overflow
- clone & push all remote branches with git
- How to delete the remote branch in git
- Moving git repository and all its branches, tags to a new remote repository keeping commits history
- How to .gitignore all files/folder in a folder, but not the folder itself?
- How to restart computer in remote connection
- How to intsall Git on Ubuntu
- How to Get All Product Images in products list page?
- How to identify all the Corrupted Objects in the Database reported by RMAN
- How to search All-In-OneCode Framework with google or Bing
- Problem 17 - How many letters would be needed to write all the numbers in words from 1 to 1000?
- How to Clone VMs in ESXi
- How to Find All SQL Server Instance Running in Local Network c#
- [How To] Remove All Hyperlinks in Word or Excel
- How to Get All Product Images in products list page?
- Git 管理多个分支的公共部分 How to manage the common part of multiple branches
- All-In-One Code Framework(AIO): 如何使用C#编写进程外的COM组件 (How to write an out-of-proc COM server in C#)
- How to lock computer in Remote Desktop Connection?(如何给远程桌面锁屏?)
- Magento: How to list all the products in a single category in a sidebar block