Search code examples
gitazurepullgit-remote

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) .

Now there is a new feature in project X , which i want to pull it to my Azure repository .

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

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

Thanks a lot !


Solution

  • 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. Then step-by-step would be

    1. switch to the master branch to get the new feature update from project 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. Since you already cloned from project X and pushed to your own repo. Those should already be tracked in your local repo.