推进承诺回购,但服务器上的回购不包含任何文件(Pushed commits into repo, but repo on server contains no files)

编程入门 行业动态 更新时间:2024-10-24 13:23:43
推进承诺回购,但服务器上的回购不包含任何文件(Pushed commits into repo, but repo on server contains no files)

我对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 master

which 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.

更多推荐

本文发布于:2023-08-06 17:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1454121.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不包含   器上   文件   Pushed   files

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!