开发者

Can a git repository be cloned directly into a github account?

开发者 https://www.devze.com 2023-02-06 04:40 出处:网络
I work in multiple different computers and use github sync my projects. It is extremely useful when I create a repository from scratch or fork from github. Is it possible to clone a repository directl

I work in multiple different computers and use github sync my projects. It is extremely useful when I create a repository from scratch or fork from github. Is it possible to clone a repository directly into github so all my local clones remote the github repo and in return, github repo remotes the original one.

Addendum: I am quiet new to git and what I actuall开发者_JS百科y want is to keep my own work in sync without interacting with the original repository(other than pulling updates).

I came up with this scheme:

          github
    *<----->*<-------> PC1
original    ^--------> Pc2
            ^--------> PC3

where <---> shows pulling and pushing. Maybe I am approaching this from a wrong angle.


Create the github repo and push one of your local clones to it. You'll probably need git push git@github.com:... master. Then, use git remote add <name> <url> in all your local clones.

I don't see why you need the github repo to have your repository as a remote--you won't be using that copy of the repo with a working directory.


git remote add gh ssh://user@github/whatever
git push gh --all
0

精彩评论

暂无评论...
验证码 换一张
取 消