mannuk
mannuk

Reputation: 1269

How to merge my local project with a github project?

Some months ago, I downloaded a GitHub project (https://github.com/Unidata/thredds) in order to adapt some parts of the code and to develop it in Eclipse (The creators develop the project in Intellij) and I downloaded the zip file, therefore I didn't clone the repo.

On the other hand, my local project is out of date and I would like to update the local project through the GitHub original project.

Edit:

My project folder includes a .gitignore folder but it does not include a .git folder so there is no reference to the master/original

I've done this:

$ git init
$ git remote add upstream https://github.com/Unidata/thredds.git
$ git fetch upstream
remote: Counting objects: 172902, done.
remote: Compressing objects: 100% (54837/54837), done.
remote: Total 172902 (delta 106502), reused 172153 (delta 106046)
Receiving objects: 100% (172902/172902), 813.46 MiB | 1.70 MiB/s, done.
Resolving deltas: 100% (106502/106502), done.
From https://github.com/Unidata/thredds
 * [new branch]      17gridfc   -> upstream/17gridfc
 * [new branch]      4.5.0      -> upstream/4.5.0
 * [new branch]      4.5.1      -> upstream/4.5.1
 * [new branch]      4.5.2      -> upstream/4.5.2
 * [new branch]      d4test     -> upstream/d4test
 * [new branch]      d4test0    -> upstream/d4test0
 * [new branch]      d4test1    -> upstream/d4test1
 * [new branch]      http43     -> upstream/http43
 * [new branch]      opuls      -> upstream/opuls
 * [new branch]      target-4.3.21 -> upstream/target-4.3.21
 * [new branch]      target-4.3.22 -> upstream/target-4.3.22
 * [new branch]      target-4.3.23 -> upstream/target-4.3.23
 * [new branch]      target-4.4.0 -> upstream/target-4.4.0
 * [new branch]      target-4.4.2 -> upstream/target-4.4.2
 * [new branch]      target-4.4.3 -> upstream/target-4.4.3
 * [new branch]      test3      -> upstream/test3
 * [new branch]      test_framework -> upstream/test_framework
 * [new branch]      try-gradleInitForMaven -> upstream/try-gradleInitForMaven
 * [new branch]      x452       -> upstream/x452
From https://github.com/Unidata/thredds
 * [new tag]         thredds-4.3.10 -> thredds-4.3.10
 * [new tag]         v4.3.11    -> v4.3.11
 * [new tag]         v4.3.12    -> v4.3.12
 * [new tag]         v4.3.13    -> v4.3.13
 * [new tag]         v4.3.14    -> v4.3.14
 * [new tag]         v4.3.15    -> v4.3.15
 * [new tag]         v4.3.16    -> v4.3.16
 * [new tag]         v4.3.17    -> v4.3.17
 * [new tag]         v4.3.18    -> v4.3.18
 * [new tag]         v4.3.19    -> v4.3.19
 * [new tag]         v4.3.20    -> v4.3.20
 * [new tag]         v4.3.22    -> v4.3.22
 * [new tag]         v4.3.8-BETA -> v4.3.8-BETA
 * [new tag]         v4.3.9.alpha1 -> v4.3.9.alpha1
 * [new tag]         v4.4.0     -> v4.4.0
 * [new tag]         v4.4.1     -> v4.4.1
 * [new tag]         v4.4.2     -> v4.4.2
 * [new tag]         v4.5.0     -> v4.5.0
 * [new tag]         v4.5.1     -> v4.5.1

I know I have the 4.3.15 in my local folder and I would like to update it to the 4.3 last version and then commit my changes to github without changing the original. Maybe, I have to create a fork or something from my local project but I don't know how to update it properly and commit the changes to my own version.

regards

Upvotes: 2

Views: 581

Answers (1)

barni
barni

Reputation: 56

I would do it with these steps:

1) Check out the v4.3.15 branch to a separate directory

2) Run a diff check to check for the differences between the checked out version and your own version.

3) Apply your changes to the checked out branch.

4) Commit your changes locally. Now you have a commit that consists of the changes you made to the 4.3.15 version)

5) Rebase your commit on top of the latest version you are interested in (I suppose it is the 4.3.23).

6) Solve any conflicts that you might have.

7) Commit your changes locally.

8) Push your changes to GitHub.

Upvotes: 1

Related Questions