Git远程回购中的项目文件在哪里? [英] where are project files in remote repo in Git?

查看:613
本文介绍了Git远程回购中的项目文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Git和我的项目VCS. 我已经使用

I start to use Git and my project VCS. I have created a remote repo using

git init --bare 

在/codes-repo中

并将更改从本地存储库推送到那里.然后我想将项目文件从那里移动到/var/www/project,以供http://....访问.但我在/codes-repo上看不到任何项目文件(index.php,css/,....)来复制它们,那里只有git文件和文件夹. 他们在哪里?

in /codes-repo and push changes from local repo to there. then I want to move project files from there to /var/www/project to be accessible for http://.... . but I don't see any project files (index.php,css/,....) at /codes-repo to copy them, there are only git files and folders there. Where are them??

推荐答案

裸仓库没有签出.也就是说,裸仓库仅保留提交信息-不会在仓库文件夹内的磁盘上保留实际文件的副本.

A bare repository does not have a checkout. That is to say, a bare repository only holds the commit information - it does not keep a copy of the actual files on disk within the repository folder.

裸仓库只能推入或拉出.要保留文件,最好的选择是克隆裸存储库(作为非裸克隆),然后在该克隆上运行检出.

Bare repositories can only be pushed to or pulled from. To get a hold of the files, your best bet is probably to clone the bare repository (as a non-bare clone), and run a checkout at the clone.

如果您觉得很勇敢,可以选择另一种方法是将裸仓库转换为非裸仓库(

Another option, if you're feeling brave, is to convert the bare repository into a non-bare repository (How do I convert a bare git repository into a normal one (in-place)?)

这篇关于Git远程回购中的项目文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆