将旧源代码放入新存储库
简单的问题:
我遇到了一个小问题,我只需要深入了解应该如何处理我拥有的一些代码。
我有一个存储库,位于两个位置。 “旧”代码位于 /originalcode
中,新的签出代码位于 /just-checked-out
中。
问题是这样的:
在过去的几个月里,我一直在更新 /originalcode
中的代码,并且对代码进行了一些新的更新(我对我的存储库有点懒,从未提交新的更改) 。
我想使用新协议将所有更改合并到代码存储库中(我从 git+ssh 更改为智能 http)。
这就像更改 git 配置文件中的“远程”url 一样简单吗?我只是想确保我遵循正确的指导方针并且不要忽视某些事情。
Quick question:
I've run into a little issue, where I just need some insight into what I should do with some code I have.
I have one repository, in two locations. The "older" code is located in /originalcode
and the new checked-out code is in /just-checked-out
.
Here's the problem:
Over the past few months, I've been updating code in /originalcode
and there have been several new updated to the code (I kinda got lazy with my repository and never commited new changes).
I'm wanting to merge all my changes into the code repository using the new protocol (I changed from git+ssh to smart http).
Is this as easy as changing the "remote" url in the git config file. I just want to make sure that I'm following proper guidelines and don't overlook something.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于所有远程设置,您可以将
.git/config
修改为 Greg 提及,...或者你应该看看
git remote
命令:将达到相同的效果,但有更多选项(set-head
、set-branches
, ...),无需查看git config
手册页。
For all remote settings, you can fiddle with
.git/config
as Greg mentions,... or you should have a look to
git remote
command: that will achieve the same effect, but with much more options (set-head
,set-branches
, ...), without having to look atgit config
man page.是的,您可以更改 .git/config 中的 URL,这将更改远程 URL 指向的位置。没有其他配置需要更改。
Yes, you can change the URL in
.git/config
and that will change where the remote URL points to. There's no other configuration that needs to be changed.