如何“git推送”到以只读方式克隆到我团队的登台服务器上的存储库

发布于 2024-09-15 03:27:24 字数 163 浏览 4 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

淡忘如思 2024-09-22 03:27:25

在您最喜欢的文本编辑器中打开 .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.

我爱人 2024-09-22 03:27:25

如果您只想设置推送网址,可以使用 --push 选项

git remote set-url --push origin [email protected]:leo/repox.git

if you only want to set the push url you can use the --push option

git remote set-url --push origin [email protected]:leo/repox.git
提笔落墨 2024-09-22 03:27:25

来自 GitHub 使用远程 帮助页面:

更改远程 URL

没有直接命令可以更改远程 URL,因此您通常会运行 git remote rm,然后运行 ​​git remote add 来更改 URL。
您还可以直接编辑存储库的 .git/config 文件来更改 URL,而无需重新获取远程。

我建议(参见这个SO问题):

git remote set-url origin git://new.url.here

使用 git 命令总是比直接手动修改 git 配置文件更好。

From GitHub Working with remote help page:

Changing a remote’s URL

There is no direct command to change a remote’s URL, so you will usually run git remote rm followed by git remote add to change a URL.
You can also edit the repo’s .git/config file directly to change the URL without re-fetching the remote.

I would recommend (see this SO question):

git remote set-url origin git://new.url.here

Using git command is always preferable to modifying directly a git config file manually.

一口甜 2024-09-22 03:27:25

我将从登台服务器获取差异,并通过 patch(1) 将其应用到开发环境中。

I'd take a diff from the staging server and apply it in a development environment via patch(1).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文