如何“git推送”到以只读方式克隆到我团队的登台服务器上的存储库
我使用 GitHub 只读 URL 将存储库克隆到我团队的临时服务器上。我对配置文件做了一些更改。
我想将服务器上的存储库克隆更改为读写,以便我可以“git Push”配置文件更改。
我该怎么做?
或者是否有比从登台服务器提交更好的“最佳实践”方法来处理这种情况?
I cloned a repo using its GitHub read-only URL onto my team's staging server. I made some changes there to the config files.
I'd like to change the repo clone on the server to be read-write, so that I can 'git push' the config file changes.
How do I do this?
Or is there a better 'best practice' way to deal with this scenario than committing from the staging server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在您最喜欢的文本编辑器中打开 .git/config 并将远程 url 更改为 github 向您显示的读+写 url。
open up .git/config in your favorite text editor and change the remote url to the read+write url that github shows you.
如果您只想设置推送网址,可以使用 --push 选项
if you only want to set the push url you can use the --push option
来自 GitHub 使用远程 帮助页面:
我建议(参见这个SO问题):
使用 git 命令总是比直接手动修改 git 配置文件更好。
From GitHub Working with remote help page:
I would recommend (see this SO question):
Using git command is always preferable to modifying directly a git config file manually.
我将从登台服务器获取差异,并通过
patch(1)
将其应用到开发环境中。I'd take a diff from the staging server and apply it in a development environment via
patch(1)
.