我对git的使用大部分都是通过一个IDE来进行的,而且我对于我认为的一件容易的事情有点噩梦。
在远程服务器上,我有gitolite运行似乎工作正常,我的本地计算机可以连接到服务器,并执行简单的任务。
我在服务器上有一个与本地回购协议名称相同的回购协议,但本地回购协议在服务器版本之前已经创建了很长时间。
经过大量阅读后,建议克隆远程,然后推送到服务器。 所以:
$ git clone ***server***:***repo*** Cloning into ***repo***... warning: You appear to have cloned an empty repository.当我这样做时,我得到一个鼓励的信息:
$ git push origin master Counting objects: 4070, done. Delta compression using up to 4 threads. Compressing objects: 100% (3737/3737), done. Writing objects: 100% (4070/4070), 15.16 MiB | 588 KiB/s, done. Total 4070 (delta 867), reused 0 (delta 0) To ***server***:***repo***.git * [new branch] master -> master $所有看起来不错... 但是这些文件不在服务器上?
我应该合并,那么rebase ...这是我的知识完全崩溃的地方。 我试图阅读git-scm文档,但我必须诚实..这是超过我的头,这似乎应该是这样一个简单的事情要做。
My usage of git has mostly been through an IDE to date and I'm having a bit of a nightmare with what I thought would be an easy thing.
On the remote server I have gitolite running which seems to be working fine, my local machine can connect to the server and perform simple tasks.
I have a repo on the server with the same name as the repo on my local however the local repo was created a long time before the server version.
After a lot of reading on SO it was recommended to clone the remote then push to the server. So:
$ git clone ***server***:***repo*** Cloning into ***repo***... warning: You appear to have cloned an empty repository.When I do this I get an encouraging message:
$ git push origin master Counting objects: 4070, done. Delta compression using up to 4 threads. Compressing objects: 100% (3737/3737), done. Writing objects: 100% (4070/4070), 15.16 MiB | 588 KiB/s, done. Total 4070 (delta 867), reused 0 (delta 0) To ***server***:***repo***.git * [new branch] master -> master $All looks good... however the files are not on the server?
Should I merge, what about rebase... this is where my knowledge completely falls apart. I've tried to read the git-scm documentation but I have to be honest.. it's way over my head and this seems like it should be such a simple thing to do.
最满意答案
服务器只包含一个裸仓库,即没有结帐。 这些文件只存储在您提到的objetcs/目录和pack文件中。 你可以做什么来验证这些文件确实存在,例如是从本地机器上的服务器创建一个新的克隆。 另外,在服务器上,你可以做一个
git ls-tree -r master它应该给你一个所有文件以及它们的模式和哈希列表。
编辑 :你会想读Pro Git书中有关服务器上Git的章节。
The server only contains a bare repository, i.e. no checkout. The files are only stored in the objetcs/ directory and the pack files you mention. What you can do to verify that the files are indeed there, is e.g. to create a new clone from the server on your local machine. Alternatively, on the server, you can do a
git ls-tree -r masterwhich should give you a list of all the files along with their mode and hashes.
EDIT: You'll want to read the chapter about Git on the server in the Pro Git book.
更多推荐
发布评论