简体   繁体   English

Git推送到远程但无法从本地拉出

[英]Git push to remote but cannot pull from local

I have one git repository on a local server. 我在本地服务器上有一个git存储库。 I want to clone my project to a server that cannot access to Internet. 我想将项目克隆到无法访问Internet的服务器上。 (only SSH available). (仅SSH可用)。 I cloned my project, then copied it on the Webserver "dev". 我克隆了我的项目,然后将其复制到Web服务器“ dev”上。

I added a "dev" git remote. 我添加了一个“ dev” git remote。

Let's say I just did a new commit that adds a new file. 假设我刚刚做了一个新的提交,添加了一个新文件。

When I do on the local server 当我在本地服务器上执行操作时

 git push dev master

It pushes everything to the remote server. 它将所有内容推送到远程服务器。 Then I do 那我做

 git log 

on the remote server, and i see the last commit in the log, but the new file does not appear in the folder. 在远程服务器上,我在日志中看到了最后一次提交,但是新文件未出现在文件夹中。

When I do on the remote server 当我在远程服务器上执行操作时

git status

# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.

But those commits were not applied on the remote server. 但是这些提交未应用于远程服务器。

I can't do 我做不到

 git pull

as the server cannot access internet and that it couldn't anyways pull from the local server. 因为服务器无法访问Internet,并且无论如何也无法从本地服务器中拉出。

What command could I do to apply the changes on the remote server ? 我该怎么做才能将更改应用到远程服务器上?

Thank you very much. 非常感谢你。

You are pushing to non-bare repository. 您正在推向非裸仓库。 Do you see a warning message? 您看到警告消息了吗?

Anyway read this: 无论如何,请阅读以下内容:

wekeroad.com/2011/09/17/deploying-a-site-with-git-hooks and wekeroad.com/2011/09/17/deploying-a-site-with-git-hooks

ryanflorence.com/deploying-websites-with-a-tiny-git-hook ryanflorence.com/deploying-websites-with-a-tiny-git-hook

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM