Cloning Multiple Branches in GitHub for Windows

做~自己de王妃 提交于 2019-12-03 12:44:52

问题


I sometimes need to have two different branches of a GitHub repo on my local disk at the same time. (especially when dealing with gh-pages)

I usually do this by making multiple clones of the repo in different folder, with clone using a different branch.

Is it possible to do this in the GitHub for Windows UI? (as opposed to switching a single local clone from one branch to another)
It looks like the only way to switch between local clones is to drag the new clone into the UI every time.


回答1:


I don't think it is possible to do what you want to do with the current version (1.0.9.2) but here is what I do to work on two branches.

  1. Clone the two branches from the Git Shell

    git clone https://your-project/master/ master

    git clone https://your-project/gh-pages/ gh-pages

  2. In Git for Windows, drag & drop the folder you want to work on.

  3. To switch branch, drag & drop the folder for the other branch.


来源:https://stackoverflow.com/questions/11000336/cloning-multiple-branches-in-github-for-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!