Git Workflow: Share code between computers without pushing to public repo

后端 未结 3 952
你的背包
你的背包 2021-02-07 07:07

I work at a company which uses Git for our version control. We\'re using a hosted repo service (Beanstalk) as our internal \"public\" (by that I mean accessible to the whole dev

3条回答
  •  长情又很酷
    2021-02-07 07:37

    You can push, fetch and pull between the machines freely assuming you have ssh access between them:

    git push computer2:projects/prog HEAD:tmp
    

    or, if you are on computer2:

    git pull computer1:projects/prog HEAD
    

    or

    git fetch computer1:prj/prog branch1:t1
    git fetch computer1:prj/prog branch2:t2
    git merge t1 t2
    

    or

    git fetch computer1:prj/prog branch1 branch2 branch3
    git merge FETCH_HEAD
    

    and so on... See git help fetch for more examples.

提交回复
热议问题