0

I am working on a custom modification of the tzdata package. Before knowing how to use git, I used to customize the server by modifying files directly on the server. Now I learnt to use git in this company, and I found the "tzdat-au" repo from the github below:

https://github.com/tedjp/tzdata-au

I forked the repo and become the contents below:

https://github.com/tomchiukc/tzdata-bb/commit/b4f73814d66077d4ffe9f1c18b1f9ec078ca0c96

Then I found that the contents had not updated for 4 to 5 years. To catch up with it, I followed the files in tzdata and updated my code with tzdata-2014g. But then, I found that when I need to make it, more and more files I will need. Then I came across with the repo below:

https://github.com/eggert/tz/compare

Now, the question is: if I want to keep my repo up to date, I have to get update to the grandpa repo above. So how can I make repo to get update from it?


I found this after I asked my questions: 

How do I update a GitHub forked repository?

I tried but failed with such errors:

tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ git remote add upstream https://github.com/eggert/tz.git fatal: remote upstream already exists.

tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ git status On branch master Your branch is up-to-date with 'origin/master'.

Untracked files: (use "git add ..." to include in what will be committed)

tzselect

nothing added to commit but untracked files present (use "git add" to track) tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$

Any help?

Community
  • 1
  • 1
Tom K. C. Chiu
  • 776
  • 6
  • 17

1 Answers1

0

I knew why I failed before.

Since I forked my repo from another one, github already made the father repo as "upstream" repo. Therefore, if I tried to do the same, as there is already a label called "upstream". THe method was not working.

However, if I changed the label, everything works fine. Here is the output:

   tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ git fetch upstream
   From https://github.com/tedjp/tzdata-au
    * [new branch]      master     -> upstream/master
    * [new branch]      upstream   -> upstream/upstream
   tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ git remote add grandpa https://github.com/eggert/tz.git
   tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ git fetch grandpa
   warning: no common commits
   remote: Counting objects: 11305, done.
   remote: Compressing objects: 100% (4588/4588), done.
   remote: Total 11305 (delta 6725), reused 11277 (delta 6701)
   Receiving objects: 100% (11305/11305), 8.30 MiB | 198.00 KiB/s, done.
   Resolving deltas: 100% (6725/6725), done.
   From https://github.com/eggert/tz
    * [new branch]      master     -> grandpa/master
    * [new tag]         2014h      -> 2014h
    * [new tag]         2012e      -> 2012e
    * [new tag]         2012f      -> 2012f
    * [new tag]         2012g      -> 2012g
    * [new tag]         2012h      -> 2012h
    * [new tag]         2012i      -> 2012i
    * [new tag]         2012j      -> 2012j
    * [new tag]         2013a      -> 2013a
    * [new tag]         2013b      -> 2013b
    * [new tag]         2013c      -> 2013c
    * [new tag]         2013d      -> 2013d
    * [new tag]         2013e      -> 2013e
    * [new tag]         2013f      -> 2013f
    * [new tag]         2013g      -> 2013g
    * [new tag]         2013h      -> 2013h
    * [new tag]         2013i      -> 2013i
    * [new tag]         2014a      -> 2014a
    * [new tag]         2014b      -> 2014b
    * [new tag]         2014c      -> 2014c
    * [new tag]         2014d      -> 2014d
    * [new tag]         2014e      -> 2014e
    * [new tag]         2014f      -> 2014f
    * [new tag]         2014g      -> 2014g
   tom@bkgovsrv1:~/Dropbox/repository/tzdata-bb$ 

Not sure if I can do the make. I will try.


That answer failed. I get nothing from the grandpa repo. Any suggestions?

Tom K. C. Chiu
  • 776
  • 6
  • 17
  • 1
    What do you mean by getting nothing? You've downloaded a brand new repository with nothing in common with your current. Did you expect the files in your worktree to change with the `git fetch` operation? You'll have to start a new branch from grandpa/master or forcefully re-point your master branch to grandpa/master. – Magnus Bäck Sep 26 '14 at 16:14
  • You are right. Now I tried to pull from the grandpa/master. Since the difference is so great, I need to rebase it whole and it takes time. Get finger crossed. :-) – Tom K. C. Chiu Sep 26 '14 at 16:44