Git 从一个用户帐户拉取到另一个用户帐户
我通过 ssh 访问 Linux 服务器。我在该服务器上有两个用户帐户。一名用户用于开发,一名用户用于生产。
它是关于一个在每个用户的 public_html 文件夹上运行的 web 应用程序,我通过访问 server_address/~user_account_name 来访问该应用程序。
在使用 ssh 的这些帐户上,我创建了一些 git 存储库。为了更新生产帐户,我执行 git log --name-status -n3 并复制已修改的文件。
问题是我想从一个帐户转到另一个帐户,但我不知道该怎么做。
你能给我一些建议吗?
I access a linux server by ssh. I have two user accounts on that server. One user for development and one user for production.
It is about a webapp which runs on public_html folder of each user and I access the application by visiting server_address/~user_account_name
On those accounts using the ssh, I've made some git repositories. In order to make updates to production account, i do a git log --name-status -n3
and copy the files which were modified.
The thing is that I'll like to pull from one account to another but I don't know how to do it.
Can you give me some advices?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,这很容易。首先,您必须确保每个用户帐户中的 public_html 目录是 git 存储库。可能最好的方法是
为了使其工作,您可能必须调整开发
public_html
存储库的权限。我可能建议创建一个名为“网站”或其他名称的组,将生产用户和开发用户添加到其中,然后运行然后,每当您需要将文件从开发站点复制到生产站点时,您可以运行
您也可以对这篇博客文章感兴趣我的其中我描述了如何使用 git 在临时服务器和生产服务器上管理我的网站。这是一种稍微奇特的方法,因为涉及多台计算机,但我发现它工作得很好。
Sure, that's easy. First, you have to make sure that the public_html directory within each user account is a git repository. Probably the best way to do this is to
In order for this to work, you may have to adjust the permissions on the development
public_html
repository. I'd probably suggest making a group called "website" or something, adding both the production and development users to it, and runningAfterwards, whenever you need to copy files from the development site to the production site, you can run
You may also be interested in this blog post of mine in which I describe how I manage my website on staging and production servers using git. It's a slightly fancier approach because there are multiple computers involved, but I've found it to work pretty well.