我想创建一个--bare
库通过SSH和push
,fetch
,merge
,pull
,并从该存储库通过添加远程产地到您所创建的那些地方访问。
喜欢的东西
/home/git $ git init --bare your_repository.git
/your/current/repository $ git remote add origin /home/git/your_repository.git
而且从另一个机器
/client/path $ git init
/client/path $ git remote add origin [email protected]:/home/git/your_repository.git
/client/path $ git pull origin
然后
/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
这只是一个例子,--bare
库可以在任何地方。
看一看这里的利弊http://git-scm.com/book/ch4-1.html
不仅仅是谷歌如何使用SSH登录到远程计算机。 –
要通过SSH克隆Git存储库,您可以指定ssh:// URL,如下所示:git clone ssh:// user @ server:project.git 或者您无法指定协议 - 如果您不显式:git克隆用户@服务器:project.git 您也可以不指定用户,并且Git假定您当前登录的用户为.. – Shunya
感谢您的时间,这些任务是配置ssh和克隆独立于这种情况下?我看过有关将公钥添加到github帐户的帖子,但是我不需要在这里正确吗?一旦我生成密钥什么是启动ssh的过程? – parameswar