GitHub: mapping a branch to a different local directory on Windows

We have a project which was built using TFS as the source control. This has now been placed on GitHub.

We've also added a gh-pages branch on GitHub for the documentation.

However, we don't want the documentation files to clutter the main working directory.

How can I configure the local directory for gh-pages to be in a different location?

I've tried using git-new-workdir as found here, but Powershell told me

repository 'git@github.com/git/git.git' does not exist

I then tried cloning the Powershell script found here in place of the missing script from the previous example, but then I get the error message

[script path] not valid: is this a git repository?

Can someone please explain (in novice terms) how to map a branch to a different local directory?

[And for clarification, the local system is Windows, so available tools are GitHub for Windows and Powershell.]


This can easily be solved by using 2 separate repositories. For example, projectname and projectname-docs .

By doing this, you can clone both repositories into completely separate folders as you desire.

I believe that this is the easiest (and likely only) way to do what you are asking using GitHub for Windows.


Alternatively, you could use command line git and clone the repository twice. You could use the first clone for your main working directory, and the second clone for gh-pages .

If this is something you are considering, you may want to have a look at this:

How to clone a specific Git branch?

链接地址: http://www.djcxy.com/p/16046.html

上一篇: 将git工作目录导入第二个git存储库

下一篇: GitHub:将分支映射到Windows上的其他本地目录