[英]converting a local git folder as a remote repository
sorry if my question is too naive. 对不起,如果我的问题太幼稚。 Here is what i am trying to do: 这是我想做的事情:
In the git bash guide, they are adding the public key to github, i dont want that 在git bash指南中,他们将公钥添加到github,我不希望那样
In short i have created a git repository by 'git init .' 简而言之,我已经通过'git init'创建了一个git仓库。
I don't know how to proceed further, Would anyone be able to help in this case ? 我不知道该如何进一步进行,在这种情况下,有人可以提供帮助吗?
I'd create a --bare
repository somewhere accessible via SSH and push
, fetch
, merge
, pull
to and from that repository by adding a remote origin to the ones you created. 我将创建一个--bare
存储库,该存储库可通过SSH进行访问,并通过向您创建的存储库添加远程源, merge
push
, fetch
, merge
, pull
往返该存储库。
Something like 就像是
/home/git $ git init --bare your_repository.git
/your/current/repository $ git remote add origin /home/git/your_repository.git
And from another machine 并从另一台机器
/client/path $ git init
/client/path $ git remote add origin user@server:/home/git/your_repository.git
/client/path $ git pull origin
Then 然后
/your/current/repository $ git fetch origin
/your/current/repository $ git merge origin/master
/your/current/repository $ git push origin master
/client/path $ git fetch origin
/client/path $ git merge origin/master
/client/path $ git push origin master
That's just an example, the --bare
repository can be anywhere. 只是一个例子,-- --bare
信息库可以在任何地方。
Have a look here for pros and cons http://git-scm.com/book/ch4-1.html 在这里看看优缺点http://git-scm.com/book/ch4-1.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.