到目前为止,我只使用GIT来控制我的本地文件,我现在正在尝试在远程服务器上设置一个临时环境,以便以后我可以使用GIT将本地开发文件推送到登台服务器,最终到生产服务器。
所以我做的是:
在我的登台服务器上初始化了一个裸git存储库
将该服务器添加为我本地版本的网站上的删除
然后跑: git push origin master
我没有收到任何错误信息,但暂存仓库是空的,只有.git文件夹得到更新,但实际文件没有跟进。
我在这里找到了一个类似的问题Git:从本地仓库推出的文件没有显示在远程git仓库中 ,虽然我仍然没有得到我应该做的推送我的本地文件?
实现这种设置的正确方法是什么?
谢谢
So far i only used GIT to version control my local files, i am now trying to set up a staging environment on a remote server so that later i can push my local development files to the staging server using GIT and eventually to a production server.
So what i did was:
initallizaed a bare git repository on my staging server
Added that server as a remove on my local version of the site
Then ran : git push origin master
I get no error message yet the staging repo is empty, well only the .git folder got updated but the actual files didn't follow.
I found a similar question here Git: Files pushed from local repo not showing up in remote git repo, though i still don't get what i am supposed to do to push my local files?
What would be the proper way to go to achieve this setup ?
Thanks
最满意答案
好的,这就是我到目前为止所得到的。
将git repo推送到远程服务器不会上传实际文件,而是上传这些文件的“蓝图”。 因此,一旦将repo上载到远程服务器,为了能够处理这些文件,您需要克隆该repo。 之后,工作流程为:
1-将文件从本地Push送到远程仓库(中央回购)
2-克隆实例可以从该存储库中pull更改以保持最新状态。
如果我弄错了,请纠正我。
Ok so here is what i got so far.
Pushing a git repo to a remote server does not upload the actual files but rather the "blueprint" of these. So once a repo has been uploaded to a remote server, to be able to work on these files you need to clone that repo. After that the workflow is:
1- Push the files from local to remote repo (central sort of repo)
2- Cloned instances can pull the changes from that repo to stay up to date.
If i got that wrong please correct me.
更多推荐
发布评论