手头有一个从别人手中拿到的工程,只给了.git 文件夹。我在本地使用的时候只需要 checkout 一下就完了。
现在我想把这个.git 变成正常使用的远程仓库,保留原有的提交记录。我该如何操作?
现在我想把这个.git 变成正常使用的远程仓库,保留原有的提交记录。我该如何操作?

1 Mirana Aug 19, 2015 放到服务器上,就行了把 远程仓库和本地仓库没有区别 |
2 gangsta Aug 19, 2015 这个可以么? git remote add origin https://github.com/username/yourrepo.git |
3 inmyfree Aug 19, 2015 可以的 先 git remote add origin https://github.com/username/yourrepo.git 如果提示已经存在了,则先 git remote rm origin 再执行 git remote add origin https://github.com/username/yourrepo.git 然后 git push 就会提交到远程仓库了 |
4 flowfire Aug 19, 2015 我记得 git 官网是有教程的。。。。叫你做个裸仓库放到服务器上。。。 倒是我上次弄非裸仓库的时候折腾的要死 |
5 shmilyin Aug 19, 2015 git remote -v 如果没有 就 git remote add origin https://github.com/username/yourrepo.git 如果有 就 git remote set-url origin https://github.com/username/yourrepo.git |
6 johnnyb Aug 20, 2015 放到你能访问到的任何地方:(本机)另一个目录,局域网,或者公网。协议无所谓,本地路径/ smb / ssh / http 都可以。 你通过什么路径访问,就在项目目录下 add 那个路径 |
7 sinsin Aug 20, 2015 假如你的仓库(.git 文件夹所在文件夹)名为 foo 在它上一级目录下执行: git clone --bare foo 就会产生一个 foo.git 的裸仓库。 这个裸仓库就是可以正常使用的远程仓库(惯例仓库目录名有.git 后缀) |