Git - separate folder for each branch. Setting it up

前端 未结 4 1742
鱼传尺愫
鱼传尺愫 2021-02-01 10:08

I have a need to keep 3 branches in 3 separate folders. (I know this is not a git way of doing things. But I need to do this for a reason).

Lets say the repo name is

4条回答
  •  佛祖请我去吃肉
    2021-02-01 10:34

    I think that you might have to create all the branch in your repo

    $ git branch 
    

    Then create all your folders and in each of your folder Clone the repo but Checkout the appropriate branches.

    Each folder should / may track only the appropriate branch

    Step 1 $ git branch [name_branch#1]
    
    Step 2 $ git branch [name_branch#2]
    
    Step 3 $ git branch [name_branch#3]
    

    ...

    Step 4 $ git push --all
    Step 5 md Folder #2
    Step 6 $ git clone [URL]
    Step 7 $ git checkout [name_branch]
    

提交回复
热议问题