OpenSource
OpenSource

Reputation: 13

Update to the latest version of project from remote branch

Problem

I have a project based on Pterodacty.io.

Take a look at their branches - they have a branch called release/v1.7.0 - this is the release my project is based on.

I have a heavily modified version of Pterodactyl v1.7.0, but I want an easy way to update my entire codebase to v1.10.4 (or for this matter any other branch, such as develop).

How can I easily compare difference and update my whole project?

For example, I want files that have not yet been touched by me to be automatically updated to the newest version. Files that have been modified and can't be merged, I want them to be shown side by side for some kind of manual review.

Technical details:

My repository is a totally separate GitHub repository, a private one.

Upvotes: 0

Views: 70

Answers (1)

Dylan Delobel
Dylan Delobel

Reputation: 834

To merge another Git repository into your repository

(I tried to guess the branch name but you may need to adjust)

  1. Use the git remote command to add the other repository as a remote to your repository. For example, if the other repository is located at https://github.com/other-user/other-repository.git, you would run the following command:
git remote add ptero https://github.com/other-user/other-repository.git
  1. Use the git fetch command to download the branches and commits from the other repository. This will not merge the changes into your repository, but it will make the branches and commits from the other repository available for you to merge.
git fetch ptero
  1. Use the git merge command to merge the changes from the other repository into your repository.
git merge ptero/v1.7.0
  1. Resolve any merge conflicts that may arise, if necessary. This may involve editing the files that have conflicts and using the git add and git commit commands to commit the resolved conflicts

And you should be up-to-date :)

Upvotes: 1

Related Questions