Push Git Project to Local Directory

后端 未结 2 1970
孤城傲影
孤城傲影 2021-02-05 06:07

Don\'t know whether this is fully supported in Git would be excellent if it is as it could make things a lot easier, basically I have a project am working on in folder X and whe

2条回答
  •  孤街浪徒
    2021-02-05 06:18

    I would assume that you want to push to Y so that you can have a checked out folder of the "previous good" changes elsewhere. The answer from @dahlbyk suggests a bare repo. If you are going that way, you can ( and probably should) rather have a branch in the same repo.

    Other than that, just clone the git repo in X into Y ( non-bare ) and either git pull from Y or setup a remote like @dahlbyk from X and push to Y. Make sure receive.denyCurrentBranch is set to false or a different branch from the branch you are pushing is checked out in Y

提交回复
热议问题