简体   繁体   English

Git 将版本从一个存储库拉到另一个存储库

[英]Git pull release from one repository to another

I cloned a project X from Github locally and made some little changes , then i created my own repository and pushed my local project to it (using Azure DevOps) .我在本地从 Github 克隆了一个项目 X 并做了一些小改动,然后我创建了自己的存储库并将我的本地项目推送到它(使用 Azure DevOps)。

Now there is a new feature in project X , which i want to pull it to my Azure repository .现在项目 X 中有一个新功能,我想将它拉到我的 Azure 存储库中。

Does anyone have an idea?有没有人有想法? currently i don't have any relation between repo X and my Azure repo , and i think i should use git remote but i don't know how exactly目前我在 repo X 和我的 Azure repo 之间没有任何关系,我想我应该使用 git remote 但我不知道具体如何

https://www.atlassian.com/git/tutorials/syncing https://www.atlassian.com/git/tutorials/syncing

Thanks a lot !非常感谢 !

Assume you have something like, origin is set to track project X, azure is set to track your own repo, and master is your local copy of project X master, little-change is with your changes.假设你有类似的东西, origin设置为跟踪项目 X, azure设置为跟踪你自己的 repo, master是你的项目 X master 的本地副本,你的更改little-change变化。 Then step-by-step would be然后一步一步将是

  1. switch to the master branch to get the new feature update from project X切换到 master 分支以从项目 X 获取新功能更新
    git checkout master git pull origin master
  2. merge the new feature with your own changes将新功能与您自己的更改合并
    git checkout little-change git pull azure little-change # probably just git pull is sufficient git merge master # fix conflict if there is any
  3. push the new stuff to your own repo将新东西推送到您自己的仓库
    git push azure little-change

you can check your remote repo name and urls using git remote -v .您可以使用git remote -v检查您的远程仓库名称和网址。 Since you already cloned from project X and pushed to your own repo.由于您已经从项目 X 克隆并推送到您自己的存储库。 Those should already be tracked in your local repo.这些应该已经在您的本地仓库中进行了跟踪。

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

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